File: ValueTest.php

package info (click to toggle)
php-doctrine-collections 2.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 468 kB
  • sloc: php: 2,531; makefile: 18
file content (36 lines) | stat: -rw-r--r-- 937 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
<?php

declare(strict_types=1);

namespace Doctrine\Tests\Common\Collections\Expr;

use Doctrine\Common\Collections\Expr\ExpressionVisitor;
use Doctrine\Common\Collections\Expr\Value;
use PHPUnit\Framework\MockObject\MockBuilder;
use PHPUnit\Framework\TestCase;

/** @covers  \Doctrine\Common\Collections\Expr\Value */
class ValueTest extends TestCase
{
    public function testGetter(): void
    {
        $value           = 'foo';
        $valueExpression = new Value($value);

        $actualValue = $valueExpression->getValue();

        self::assertEquals($value, $actualValue);
    }

    public function testVisitor(): void
    {
        $visitor = $this->getMockBuilder(ExpressionVisitor::class)->getMock();
        $visitor
            ->expects($this->once())
            ->method('walkValue');

        $value           = 'foo';
        $valueExpression = new Value($value);
        $valueExpression->visit($visitor);
    }
}