diff --git a/tests/LaboratoryTest.php b/tests/LaboratoryTest.php index 9283fa0..7e25063 100644 --- a/tests/LaboratoryTest.php +++ b/tests/LaboratoryTest.php @@ -52,7 +52,7 @@ public function test_laboratory_can_fetch_report_for_experiment_with_no_journals public function test_that_exceptions_are_thrown_within_control() { - $this->setExpectedException(Exception::class); + $this->expectException(Exception::class); $v = (new Laboratory) ->experiment('test experiment') diff --git a/tests/MachineTest.php b/tests/MachineTest.php index 0b2d694..7b80c85 100644 --- a/tests/MachineTest.php +++ b/tests/MachineTest.php @@ -7,17 +7,23 @@ class MachineTest extends \PHPUnit\Framework\TestCase { public function test_that_machine_can_be_created() { - new Machine(function () {}); + $m = new Machine(function () {}); + + $this->assertInstanceOf(Machine::class, $m); } public function test_that_machine_can_receive_parameters() { - new Machine(function () {}, [1, 2, 3]); + $m = new Machine(function () {}, [1, 2, 3]); + + $this->assertInstanceOf(Machine::class, $m); } public function test_that_machine_can_receive_mutable_state() { - new Machine(function () {}, [1, 2, 3], true); + $m = new Machine(function () {}, [1, 2, 3], true); + + $this->assertInstanceOf(Machine::class, $m); } public function test_that_machine_can_produce_a_result() @@ -47,7 +53,7 @@ public function test_that_exceptions_can_be_thrown_by_machine_callback_execution { $m = new Machine(function () { throw new Exception('foo'); }); - $this->setExpectedException(Exception::class); + $this->expectException(Exception::class); $m->execute(); } diff --git a/tests/ReportTest.php b/tests/ReportTest.php index 9bf12af..7db8950 100644 --- a/tests/ReportTest.php +++ b/tests/ReportTest.php @@ -8,7 +8,9 @@ class ReportTest extends \PHPUnit\Framework\TestCase public function test_that_report_can_be_created() { $r = new Result; - new Report('foo', $r, []); + $rep = new Report('foo', $r, []); + + $this->assertInstanceOf(Report::class, $rep); } public function test_that_report_can_hold_experiment_name() diff --git a/tests/ResultTest.php b/tests/ResultTest.php index 8739c5d..7fb3335 100644 --- a/tests/ResultTest.php +++ b/tests/ResultTest.php @@ -6,7 +6,9 @@ class ResultTest extends \PHPUnit\Framework\TestCase { public function test_result_can_be_created() { - new Result; + $r = new Result; + + $this->assertInstanceOf(Result::class, $r); } public function test_result_can_have_value()