for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sylius\Behat\Page\Admin\Product;
use Behat\Mink\Session;
use Sylius\Behat\Page\SymfonyPage;
use Sylius\Behat\TableManipulatorInterface;
use Sylius\Component\Core\Model\ProductInterface;
use Symfony\Component\Routing\RouterInterface;
/**
* @author Magdalena Banasiak <[email protected]>
class IndexPage extends SymfonyPage implements IndexPageInterface
{
* @var TableManipulatorInterface
private $tableManipulator;
* {@inheritdoc}
* @param TableManipulatorInterface $tableManipulator
public function __construct(
Session $session,
array $parameters,
RouterInterface $router,
TableManipulatorInterface $tableManipulator
) {
parent::__construct($session, $parameters, $router);
$this->tableManipulator = $tableManipulator;
}
public function isThereProduct(ProductInterface $product)
if (!$table = $this->getDocument()->find('css', 'table')) {
return false;
$row = $this->tableManipulator->getRowWithFields($table, ['id' => $product->getId()]);
return null === $row;
protected function getRouteName()
return 'sylius_backend_product_index';