95 $this->markTestSkipped(
'Failed for some unknown reason.');
98 $title =
'Revision One';
99 $file_stream = Streams::ofString(
'Test Content');
101 $this->storage_mock->expects($this->any())
103 ->willReturn($this->manager_mock);
105 $this->db_mock->expects($this->any())
107 ->willReturnCallback(
function ($query): MockObject {
108 $mock_object = $this->createMock(ilDBStatement::class);
109 $mock_object->expects($this->any())->method(
'fetchAssoc')->willReturn([$query]);
114 $this->db_mock->expects($this->any())
115 ->method(
'fetchAssoc')
116 ->willReturnCallback(
function (
ilDBStatement $statement): ?array {
122 if (str_contains($query,
'last_update')) {
133 $file = $this->getMockBuilder(ilObjFile::class)
134 ->onlyMethods([
'update'])
136 $file->method(
'update');
139 $property =
$r->getProperty(
'just_notified');
140 $property->setAccessible(
true);
141 $property->setValue($file,
true);
143 $this->db_mock->expects($this->any())
144 ->method(
'fetchAssoc')
158 [
'the_identification', $rid],
159 [
'the_identification', $rid],
162 ->expects($this->any())
164 ->willReturnCallback(
166 $expected = array_shift($consecutive);
167 [$eid, $ret] = $consecutive;
168 $this->assertEquals($eid, $id);
173 $this->manager_mock->expects($this->once())
179 $revision->setVersionNumber(1);
180 $revision->setTitle($title);
182 $resource->addRevision($revision);
184 $this->manager_mock->expects($this->once())
185 ->method(
'getCurrentRevision')
187 ->willReturn($revision);
189 $this->manager_mock->expects($this->any())
190 ->method(
'getResource')
192 ->willReturn($resource);
194 $revision_number = $file->appendStream($file_stream, $title);
195 $this->assertEquals(1, $revision_number);
196 $this->assertEquals(1, $file->getVersion());
197 $this->assertEquals($title, $file->getTitle());
Class ilObjFileStakeholder.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
Class ResourceIdentification.
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins