File: RulesetTest.php

package info (click to toggle)
php-doctrine-inflector 2.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 536 kB
  • sloc: php: 3,308; makefile: 17
file content (55 lines) | stat: -rw-r--r-- 1,399 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php

declare(strict_types=1);

namespace Doctrine\Tests\Inflector\Rules;

use Doctrine\Inflector\Rules\Patterns;
use Doctrine\Inflector\Rules\Ruleset;
use Doctrine\Inflector\Rules\Substitutions;
use Doctrine\Inflector\Rules\Transformations;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;

class RulesetTest extends TestCase
{
    /** @var Transformations&MockObject */
    private $regular;

    /** @var Patterns&MockObject */
    private $uninflected;

    /** @var Substitutions&MockObject */
    private $irregular;

    /** @var Ruleset */
    private $ruleset;

    public function testGetRegular(): void
    {
        self::assertSame($this->regular, $this->ruleset->getRegular());
    }

    public function testGetUninflected(): void
    {
        self::assertSame($this->uninflected, $this->ruleset->getUninflected());
    }

    public function testGetIrregular(): void
    {
        self::assertSame($this->irregular, $this->ruleset->getIrregular());
    }

    protected function setUp(): void
    {
        $this->regular     = $this->createMock(Transformations::class);
        $this->uninflected = $this->createMock(Patterns::class);
        $this->irregular   = $this->createMock(Substitutions::class);

        $this->ruleset = new Ruleset(
            $this->regular,
            $this->uninflected,
            $this->irregular
        );
    }
}