DeviceRepositoryTest::testApp()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
/**
3
 * Push notification server example (http://github.com/juliangut/tify_example)
4
 *
5
 * @link https://github.com/juliangut/tify_example for the canonical source repository
6
 *
7
 * @license https://github.com/juliangut/tify_example/blob/master/LICENSE
8
 */
9
10
namespace Jgut\Pusher\Tests\Repository;
11
12
use Doctrine\ORM\EntityManager;
13
use Doctrine\ORM\Mapping\ClassMetadata;
14
use Jgut\Pusher\Entity\DeviceEntity;
15
use Jgut\Pusher\Repository\DeviceRepository;
16
17
/**
18
 * Class DeviceRepositoryTest
19
 */
20
class DeviceRepositoryTest extends \PHPUnit_Framework_TestCase
21
{
22
    /**
23
     * @var DeviceRepository
24
     */
25
    protected $repository;
26
27
    /**
28
     * {@inheritdoc}
29
     */
30
    public function setUp()
31
    {
32
        $entityManager = $this->getMockBuilder(EntityManager::class)->disableOriginalConstructor()->getMock();
33
        $entityManager->expects(self::once())->method('persist');
34
        $entityManager->expects(self::once())->method('flush');
35
36
        $this->repository = new DeviceRepository($entityManager, new ClassMetadata('DeviceEntity'));
37
    }
38
39
    public function testApp()
40
    {
41
        $this->repository->saveDevice(new DeviceEntity);
42
    }
43
}
44