DoctrineAssertTrait::assertRepositoryNotContains()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
c 0
b 0
f 0
ccs 0
cts 3
cp 0
rs 10
cc 1
nc 1
nop 2
crap 2
1
<?php
2
/*******************************************************************************
3
 *  This file is part of the GraphQL Bundle package.
4
 *
5
 *  (c) YnloUltratech <[email protected]>
6
 *
7
 *  For the full copyright and license information, please view the LICENSE
8
 *  file that was distributed with this source code.
9
 ******************************************************************************/
10
11
namespace Ynlo\GraphQLBundle\Test\Assert;
12
13
use Symfony\Bundle\FrameworkBundle\Client;
14
15
/**
16
 * @method Client getClient()
17
 *
18
 * @requires DoctrineHelperTrait
19
 *
20
 * @deprecated in favor of Behat tests
21
 */
22
trait DoctrineAssertTrait
23
{
24
    /**
25
     * @param string $class
26
     * @param array  $criteria
27
     */
28
    public static function assertRepositoryContains($class, $criteria)
29
    {
30
        static::assertNotNull(static::getRepository($class)->findOneBy($criteria));
31
    }
32
33
    /**
34
     * @param string $class
35
     * @param array  $criteria
36
     */
37
    public static function assertRepositoryNotContains($class, $criteria)
38
    {
39
        static::assertNull(static::getRepository($class)->findOneBy($criteria));
40
    }
41
}
42