Last active
March 19, 2019 15:49
-
-
Save danielpotthast/e35e63335ba7afd4ecbf505a22fca580 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class ProductListTest extends \PHPUnit_Framework_TestCase | |
{ | |
public function testProductList() | |
{ | |
$listedProduct = $this->prophesize(ProductListInterface::class); | |
$listedProduct->isListed()->willReturn(true); | |
$notListedProduct = $this->prophesize(ProductListInterface::class); | |
$notListedProduct->isListed()->willReturn(false); | |
$productList = new ProductList( | |
[ | |
$listedProduct->reveal(), | |
$notListedProduct->reveal(), | |
] | |
); | |
$this->assertCount(1, $productList->getListedProducts()); | |
$this->assertContains($listedProduct->reveal(), | |
$productList->getListedProducts()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment