ILIAS  trunk Revision v11.0_alpha-1713-gd8962da2f67
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
DataFactoryTest.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
25 
26 class DataFactoryTest extends TestCase
27 {
28  public function testCreateData(): void
29  {
30  $factory = new DataFactory();
31  $data = $factory->data(Type::VOCAB_VALUE, 'value');
32 
33  $this->assertInstanceOf(DataInterface::class, $data);
34  }
35 
36  public function testCreateDataSlotNotNull(): void
37  {
38  $factory = new DataFactory();
39  $data = $factory->data(
40  Type::VOCAB_VALUE,
41  'value',
42  SlotIdentifier::CLASSIFICATION_PURPOSE
43  );
44 
45  $this->assertInstanceOf(DataInterface::class, $data);
46  }
47 
48  public function testCreateNullData(): void
49  {
50  $factory = new DataFactory();
51  $null_data = $factory->null();
52 
53  $this->assertInstanceOf(DataInterface::class, $null_data);
54  $this->assertSame(Type::NULL, $null_data->type());
55  }
56 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...