Skip to content

Commit

Permalink
Fix tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dayle Rees committed Mar 14, 2018
1 parent 5068867 commit c3dd321
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion tests/LaboratoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
14 changes: 10 additions & 4 deletions tests/MachineTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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();
}
Expand Down
4 changes: 3 additions & 1 deletion tests/ReportTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 3 additions & 1 deletion tests/ResultTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit c3dd321

Please sign in to comment.