SubscriptionRepositoryTest added.
This commit is contained in:
parent
00b7c1d2f5
commit
0cf5814c7a
|
@ -0,0 +1,39 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tests\Skobkin\PointToolsBundle\Repository;
|
||||||
|
|
||||||
|
use Doctrine\ORM\EntityManager;
|
||||||
|
use Skobkin\Bundle\PointToolsBundle\Repository\SubscriptionRepository;
|
||||||
|
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
||||||
|
|
||||||
|
class SubscriptionRepositoryTest extends KernelTestCase
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @var EntityManager
|
||||||
|
*/
|
||||||
|
private $em;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var SubscriptionRepository
|
||||||
|
*/
|
||||||
|
private $subscriptionRepo;
|
||||||
|
|
||||||
|
protected function setUp()
|
||||||
|
{
|
||||||
|
self::bootKernel();
|
||||||
|
|
||||||
|
$this->em = static::$kernel->getContainer()->get('doctrine')->getManager();
|
||||||
|
$this->subscriptionRepo = $this->em->getRepository('SkobkinPointToolsBundle:Subscription');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testGetUserSubscribersCountById(): int
|
||||||
|
{
|
||||||
|
$count = $this->subscriptionRepo->getUserSubscribersCountById(99999);
|
||||||
|
|
||||||
|
$this->assertInternalType('int', $count, 'Not integer returned');
|
||||||
|
$this->assertGreaterThanOrEqual(2, $count, 'Lesser than 2 subscribers found');
|
||||||
|
$this->assertLessThanOrEqual(5, $count, 'More than 5 subscribers found');
|
||||||
|
|
||||||
|
return $count;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue