ILIAS  trunk Revision v11.0_alpha-1689-g66c127b4ae8
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
AssociationTest.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
26 
27 class AssociationTest extends TestCase
28 {
29  public function testConstruct(): void
30  {
31  $field = $this->getMockBuilder(Field::class)->disableOriginalConstructor()->getMock();
32  $ref_field = $this->getMockBuilder(Field::class)->disableOriginalConstructor()->getMock();
33 
34  $instance = new Association($field, $ref_field);
35  $this->assertInstanceOf(Association::class, $instance);
36  }
37 
38  public function testField(): void
39  {
40  $field = $this->getMockBuilder(Field::class)->disableOriginalConstructor()->getMock();
41  $ref_field = $this->getMockBuilder(Field::class)->disableOriginalConstructor()->getMock();
42 
43  $instance = new Association($field, $ref_field);
44  $this->assertEquals($field, $instance->field());
45  }
46 
47  public function testReferenceField(): void
48  {
49  $field = $this->getMockBuilder(Field::class)->disableOriginalConstructor()->getMock();
50  $ref_field = $this->getMockBuilder(Field::class)->disableOriginalConstructor()->getMock();
51 
52  $instance = new Association($field, $ref_field);
53  $this->assertEquals($ref_field, $instance->referenceField());
54  }
55 }