Completed
Push — 7.0_master_link_manager_merge ( e446e3 )
by André
77:34 queued 60:56
created

assertHandlerAcceptsCriterion()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 2
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * @copyright Copyright (C) eZ Systems AS. All rights reserved.
5
 * @license For full copyright and license information view LICENSE file distributed with this source code.
6
 */
7
namespace eZ\Publish\Core\Persistence\Legacy\Tests\URL\Query\CriterionHandler;
8
9
use eZ\Publish\Core\Persistence\Legacy\URL\Query\CriterionHandler;
10
use PHPUnit\Framework\TestCase;
11
12
abstract class CriterionHandlerTest extends TestCase
13
{
14
    abstract public function testAccept();
15
16
    abstract public function testHandle();
17
18
    /**
19
     * Check if critetion handler accepts specyfied criterion class.
20
     *
21
     * @param CriterionHandler $handler
22
     * @param string $criterionClass
23
     */
24
    protected function assertHandlerAcceptsCriterion(CriterionHandler $handler, $criterionClass)
25
    {
26
        $this->assertTrue($handler->accept($this->createMock($criterionClass)));
27
    }
28
29
    /**
30
     * Check if critetion handler rejects specyfied criterion class.
31
     *
32
     * @param CriterionHandler $handler
33
     * @param string $criterionClass
34
     */
35
    protected function assertHandlerRejectsCriterion(CriterionHandler $handler, $criterionClass)
36
    {
37
        $this->assertFalse($handler->accept($this->createMock($criterionClass)));
38
    }
39
}
40