Skip to content

Commit

Permalink
Fixes after review
Browse files Browse the repository at this point in the history
  • Loading branch information
pjedrzejewski committed May 24, 2016
1 parent 8e8f5a1 commit 084228d
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 11 deletions.
12 changes: 6 additions & 6 deletions src/Sylius/Behat/Context/Ui/Admin/DashboardContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,46 +46,46 @@ public function iOpenAdministrationDashboard()
*/
public function iShouldSeeNewOrders($number)
{
Assert::eq($this->dashboardPage->getNumberOfNewOrders(), $number);
Assert::same($this->dashboardPage->getNumberOfNewOrders(), $number);
}

/**
* @Then I should see :number new customers
*/
public function iShouldSeeNewCustomers($number)
{
Assert::eq($this->dashboardPage->getNumberOfNewCustomers(), $number);
Assert::same($this->dashboardPage->getNumberOfNewCustomers(), $number);
}

/**
* @Then there should be total sales of :total
*/
public function thereShouldBeTotalSalesOf($total)
{
Assert::eq($this->dashboardPage->getTotalSales(), $total);
Assert::same($this->dashboardPage->getTotalSales(), $total);
}

/**
* @Then the average order value should be :value
*/
public function myAverageOrderValueShouldBe($value)
{
Assert::eq($this->dashboardPage->getAverageOrderValue(), $value);
Assert::same($this->dashboardPage->getAverageOrderValue(), $value);
}

/**
* @Then I should see :number customers in the list
*/
public function iShouldSeeCustomersInTheList2($number)
{
Assert::eq($this->dashboardPage->getNumberOfNewCustomersInTheList(), $number);
Assert::same($this->dashboardPage->getNumberOfNewCustomersInTheList(), $number);
}

/**
* @Then I should see :number new orders in the list
*/
public function iShouldSeeNewOrdersInTheList($number)
{
Assert::eq($this->dashboardPage->getNumberOfNewOrdersInTheList(), $number);
Assert::same($this->dashboardPage->getNumberOfNewOrdersInTheList(), $number);
}
}
4 changes: 2 additions & 2 deletions src/Sylius/Behat/Page/Admin/DashboardPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function getTotalSales()
*/
public function getNumberOfNewOrders()
{
return $this->getElement('new_orders')->getText();
return (int) $this->getElement('new_orders')->getText();
}

/**
Expand All @@ -69,7 +69,7 @@ public function getNumberOfNewOrdersInTheList()
*/
public function getNumberOfNewCustomers()
{
return $this->getElement('new_customers')->getText();
return (int) $this->getElement('new_customers')->getText();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@ function it_is_initializable()

function it_throws_exception_if_any_of_values_if_not_an_int()
{
$this->beConstructedWith('string', 2.5, 'foo');

$this
->shouldThrow(\InvalidArgumentException::class)
->during('__construct', ['string', 2.5, 'foo'])
->duringInstantiation()
;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
namespace Sylius\Component\User\Repository;

use Pagerfanta\Pagerfanta;
use Sylius\Component\Core\Model\UserInterface;
use Sylius\Component\Core\Model\CustomerInterface;
use Sylius\Component\Resource\Repository\RepositoryInterface;

/**
Expand All @@ -25,10 +25,17 @@ interface CustomerRepositoryInterface extends RepositoryInterface
*/
public function count();

/**
* @param int $count
*
* @return CustomerInterface[]
*/
public function findLatest($count);

/**
* @param mixed $id
*
* @return null|UserInterface
* @return null|CustomerInterface
*/
public function findForDetailsPage($id);

Expand Down

0 comments on commit 084228d

Please sign in to comment.