public function getPackageStateForMicropetition(UserInterface $user)
 {
     $package = $this->sm->getPackage($user);
     $limitObj = new PackageLimitState();
     $limitObj->setLimitValue($package->getAnnouncementLimitation());
     $limitObj->setCurrentValue($user->getPetitionPerMonth());
     return $limitObj;
 }
 /**
  * @group subscription
  * @dataProvider dataLimitsAllowed
  */
 public function testPackageLimitStateAllowed($currentValue, $limit, $hasLimit, $isAllowed)
 {
     $packageLimitObj = new PackageLimitState();
     $packageLimitObj->setCurrentValue($currentValue);
     $packageLimitObj->setLimitValue($limit);
     $this->assertEquals($hasLimit, $packageLimitObj->hasLimitation());
     $this->assertEquals($isAllowed, $packageLimitObj->isAllowed());
 }