ILIAS  trunk Revision v11.0_alpha-1753-gb21ca8c4367
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
TypeSpecificDataTest.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
25 
26 class TypeSpecificDataTest extends TestCase
27 {
28  protected function getData(?int $field_id = null): TypeSpecificDataImplementation
29  {
30  return new class ($field_id) extends TypeSpecificDataImplementation {
31  public function isTypeSupported(Type $type): bool
32  {
33  return true;
34  }
35 
36  protected function getSubData(): \Generator
37  {
38  yield from [];
39  }
40  };
41  }
42 
43  public function testIsPersistedTrue(): void
44  {
45  $data = $this->getData(7);
46  $this->assertTrue($data->isPersisted());
47  }
48 
49  public function testIsPersistedFalse(): void
50  {
51  $data = $this->getData();
52  $this->assertFalse($data->isPersisted());
53  }
54 }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null