Correct variable names in specification test

Correct variable names to reflect the specifications being tested.
This commit is contained in:
Mark Davidson
2017-01-11 10:46:00 +00:00
committed by GitHub
parent b43ed2ce77
commit 3904c942d2

View File

@@ -27,20 +27,20 @@ class SpecificationTest extends \PHPUnit_Framework_TestCase
$spec1 = new PriceSpecification(50, 100); $spec1 = new PriceSpecification(50, 100);
$spec2 = new PriceSpecification(80, 200); $spec2 = new PriceSpecification(80, 200);
$orSpec = new AndSpecification($spec1, $spec2); $andSpec = new AndSpecification($spec1, $spec2);
$this->assertFalse($orSpec->isSatisfiedBy(new Item(150))); $this->assertFalse($andSpec->isSatisfiedBy(new Item(150)));
$this->assertFalse($orSpec->isSatisfiedBy(new Item(1))); $this->assertFalse($andSpec->isSatisfiedBy(new Item(1)));
$this->assertFalse($orSpec->isSatisfiedBy(new Item(51))); $this->assertFalse($andSpec->isSatisfiedBy(new Item(51)));
$this->assertTrue($orSpec->isSatisfiedBy(new Item(100))); $this->assertTrue($andSpec->isSatisfiedBy(new Item(100)));
} }
public function testCanNot() public function testCanNot()
{ {
$spec1 = new PriceSpecification(50, 100); $spec1 = new PriceSpecification(50, 100);
$orSpec = new NotSpecification($spec1); $notSpec = new NotSpecification($spec1);
$this->assertTrue($orSpec->isSatisfiedBy(new Item(150))); $this->assertTrue($notSpec->isSatisfiedBy(new Item(150)));
$this->assertFalse($orSpec->isSatisfiedBy(new Item(50))); $this->assertFalse($notSpec->isSatisfiedBy(new Item(50)));
} }
} }