Skip to content

Commit

Permalink
Merge pull request Sylius#1469 from stloyd/bugfix/ugly_typo
Browse files Browse the repository at this point in the history
Fixed typo in class and related names of loyalty rule checker
  • Loading branch information
Paweł Jędrzejewski committed May 12, 2014
2 parents 44ce282 + ee527b8 commit 01aaa08
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*
* @author Saša Stamenković <umpirsky@gmail.com>
*/
class UserLoyalityRuleChecker implements RuleCheckerInterface
class UserLoyaltyRuleChecker implements RuleCheckerInterface
{
/**
* {@inheritdoc}
Expand Down Expand Up @@ -50,6 +50,6 @@ public function isEligible(PromotionSubjectInterface $subject, array $configurat
*/
public function getConfigurationFormType()
{
return 'sylius_promotion_rule_user_loyality_configuration';
return 'sylius_promotion_rule_user_loyalty_configuration';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
/**
* @author Saša Stamenković <umpirsky@gmail.com>
*/
class UserLoyalityRuleCheckerSpec extends ObjectBehavior
class UserLoyaltyRuleCheckerSpec extends ObjectBehavior
{
function it_should_be_initializable()
{
$this->shouldHaveType('Sylius\Component\Core\Promotion\Checker\UserLoyalityRuleChecker');
$this->shouldHaveType('Sylius\Component\Core\Promotion\Checker\UserLoyaltyRuleChecker');
}

function it_should_be_Sylius_rule_checker()
Expand All @@ -32,7 +32,7 @@ function it_should_be_Sylius_rule_checker()

function it_should_recognize_no_user_as_not_eligible(OrderInterface $subject)
{
$subject->getUser()->shouldBeCalled()->willReturn(null);
$subject->getUser()->willReturn(null);

$this->isEligible($subject, array('time' => 30, 'unit' => 'days'))->shouldReturn(false);
}
Expand All @@ -42,8 +42,8 @@ function it_should_recognize_subject_as_not_eligible_if_user_is_created_after_co
TimestampableInterface $user
)
{
$subject->getUser()->shouldBeCalled()->willReturn($user);
$user->getCreatedAt()->shouldBeCalled()->willReturn(new \DateTime());
$subject->getUser()->willReturn($user);
$user->getCreatedAt()->willReturn(new \DateTime());

$this->isEligible($subject, array('time' => 30, 'unit' => 'days'))->shouldReturn(false);
}
Expand All @@ -53,8 +53,8 @@ function it_should_recognize_subject_as_eligible_if_user_is_created_before_confi
TimestampableInterface $user
)
{
$subject->getUser()->shouldBeCalled()->willReturn($user);
$user->getCreatedAt()->shouldBeCalled()->willReturn(new \DateTime('40 days ago'));
$subject->getUser()->willReturn($user);
$user->getCreatedAt()->willReturn(new \DateTime('40 days ago'));

$this->isEligible($subject, array('time' => 30, 'unit' => 'days'))->shouldReturn(true);
}
Expand All @@ -75,8 +75,8 @@ function it_should_recognize_subject_as_not_eligible_if_user_is_created_before_c
TimestampableInterface $user
)
{
$subject->getUser()->shouldBeCalled()->willReturn($user);
$user->getCreatedAt()->shouldBeCalled()->willReturn(new \DateTime());
$subject->getUser()->willReturn($user);
$user->getCreatedAt()->willReturn(new \DateTime());

$this->isEligible($subject, array('time' => 30, 'unit' => 'days', 'after' => true))->shouldReturn(true);
}
Expand Down

0 comments on commit 01aaa08

Please sign in to comment.