ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
GenericDataTest.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
23use PHPUnit\Framework\TestCase;
25
26class GenericDataTest extends TestCase
27{
28 protected function getData(
29 ?int $id = null,
30 string $title = 'title'
33 Type::TEXT,
34 7,
35 'import_35',
36 $title,
37 'description',
38 2,
39 true,
40 false,
41 [],
42 $id
43 );
44 }
45
46 public function testIsPersistedTrue(): void
47 {
48 $data = $this->getData(7);
49 $this->assertTrue($data->isPersisted());
50 }
51
52 public function testIsPersistedFalse(): void
53 {
54 $data = $this->getData();
55 $this->assertFalse($data->isPersisted());
56 }
57
58 public function testContainsChangesFalse(): void
59 {
60 $data = $this->getData(5);
61 $this->assertFalse($data->containsChanges());
62 }
63
64 public function testContainsChangesTrue(): void
65 {
66 $data = $this->getData(8, 'something');
67 $data->setTitle('something else');
68
69 $this->assertTrue($data->containsChanges());
70 }
71}
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
return true
return['delivery_method'=> 'php',]
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...