Skip to content

Instantly share code, notes, and snippets.

@danielpotthast
Last active March 19, 2019 15:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danielpotthast/e35e63335ba7afd4ecbf505a22fca580 to your computer and use it in GitHub Desktop.
Save danielpotthast/e35e63335ba7afd4ecbf505a22fca580 to your computer and use it in GitHub Desktop.
<?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