93 $this->markTestSkipped(
'Failed for some unknown reason.');
96 $title =
'Revision One';
97 $file_stream = Streams::ofString(
'Test Content');
99 $this->storage_mock->expects($this->any())
101 ->willReturn($this->manager_mock);
103 $this->db_mock->expects($this->any())
105 ->willReturnCallback(
function ($query) {
106 $mock_object = $this->createMock(ilDBStatement::class);
107 $mock_object->expects($this->any())->method(
'fetchAssoc')->willReturn([$query]);
112 $this->db_mock->expects($this->any())
113 ->method(
'fetchAssoc')
114 ->willReturnCallback(
function (
ilDBStatement $statement): ?array {
120 if (str_contains($query,
'last_update')) {
131 $file = $this->getMockBuilder(ilObjFile::class)
132 ->onlyMethods([
'update'])
134 $file->method(
'update');
137 $property =
$r->getProperty(
'just_notified');
138 $property->setAccessible(
true);
139 $property->setValue($file,
true);
141 $this->db_mock->expects($this->any())
142 ->method(
'fetchAssoc')
156 [
'the_identification', $rid],
157 [
'the_identification', $rid],
160 ->expects($this->any())
162 ->willReturnCallback(
164 $expected = array_shift($consecutive);
165 list($eid, $ret) = $consecutive;
166 $this->assertEquals($eid, $id);
171 $this->manager_mock->expects($this->once())
177 $revision->setVersionNumber(1);
178 $revision->setTitle($title);
180 $resource->addRevision($revision);
182 $this->manager_mock->expects($this->once())
183 ->method(
'getCurrentRevision')
185 ->willReturn($revision);
187 $this->manager_mock->expects($this->any())
188 ->method(
'getResource')
190 ->willReturn($resource);
192 $revision_number = $file->appendStream($file_stream, $title);
193 $this->assertEquals(1, $revision_number);
194 $this->assertEquals(1, $file->getVersion());
195 $this->assertEquals($title, $file->getTitle());
Class ilObjFileStakeholder.
Class ResourceIdentification.
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins