File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace WikibaseSolutions \CypherDSL \Tests ;
4
+
5
+ use PHPUnit \Framework \TestCase ;
6
+ use WikibaseSolutions \CypherDSL \Alias ;
7
+ use WikibaseSolutions \CypherDSL \Tests \Unit \TestHelper ;
8
+ use WikibaseSolutions \CypherDSL \Variable ;
9
+
10
+ class AliasTest extends TestCase
11
+ {
12
+ use TestHelper;
13
+
14
+ private Alias $ alias ;
15
+
16
+ protected function setUp (): void
17
+ {
18
+ parent ::setUp ();
19
+
20
+ $ this ->alias = new Alias (
21
+ $ this ->getQueryConvertableMock (Variable::class, "a " ),
22
+ $ this ->getQueryConvertableMock (Variable::class, "b " )
23
+ );
24
+ }
25
+
26
+ public function testToQuery (): void
27
+ {
28
+ $ this ->assertSame ("a AS b " , $ this ->alias ->toQuery ());
29
+ }
30
+
31
+ public function testGetOriginal (): void
32
+ {
33
+ $ this ->assertEquals ($ this ->getQueryConvertableMock (Variable::class, "a " ), $ this ->alias ->getOriginal ());
34
+ }
35
+
36
+ public function testGetVariable (): void
37
+ {
38
+ $ this ->assertEquals ($ this ->getQueryConvertableMock (Variable::class, "b " ), $ this ->alias ->getVariable ());
39
+ }
40
+ }
You can’t perform that action at this time.
0 commit comments