ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
FieldTest.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
23use PHPUnit\Framework\TestCase;
25
26class FieldTest extends TestCase
27{
28 public function testConstruct(): void
29 {
30 $field = new Field('table', 'field');
31 $this->assertInstanceOf(Field::class, $field);
32 }
33
34 public function testTableName(): void
35 {
36 $field = new Field('table', 'field');
37 $this->assertSame('table', $field->tableName());
38 }
39
40 public function testTableNameWithAlias(): void
41 {
42 $field = new Field('table', 'field', 'alias');
43 $this->assertSame('table as alias', $field->tableName());
44 }
45
46 public function testFieldName(): void
47 {
48 $field = new Field('table', 'field');
49 $this->assertSame('table.field', $field->fieldName());
50 }
51
52 public function testFieldNameWithAlias(): void
53 {
54 $field = new Field('table', 'field', 'alias');
55 $this->assertSame('alias.field', $field->fieldName());
56 }
57
58 public function testRawFieldName(): void
59 {
60 $field = new Field('table', 'field');
61 $this->assertSame('field', $field->rawFieldName());
62 }
63
64 public function testRawFieldNameWithAlias(): void
65 {
66 $field = new Field('table', 'field', 'alias');
67 $this->assertSame('field', $field->rawFieldName());
68 }
69
70 public function testRawTableName(): void
71 {
72 $field = new Field('table', 'field');
73 $this->assertSame('table', $field->rawTableName());
74 }
75
76 public function testRawTableNameWithAlias(): void
77 {
78 $field = new Field('table', 'field', 'alias');
79 $this->assertSame('table', $field->rawTableName());
80 }
81}