mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-07-27 18:20:22 +02:00
Merge pull request #262 from mtdavidson/patch-1
Correct variable names in specification test
This commit is contained in:
@@ -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)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user