19 declare(strict_types=1);
29 protected function setUp(): void
31 $ilDB_mock = $this->getMockBuilder(ilDBInterface::class)->getMock();
32 $this->ilDB = $ilDB_mock;
38 $content = [
"acc#:#acc_add_document_btn_label#:#Add Document",
"administration#:#adm_achievements#:#Achievements"];
42 $this->assertInstanceOf(\ilObjLanguageDBAccess::class, $ilObjLanguageDBAccess);
48 $content = [
"acc#:#acc_add_document_btn_label#:#Add Document",
"administration#:#adm_achievements#:#Achievements"];
53 $result = $ilObjLanguageDBAccess->insertLangEntries(
"lang/ilias_en.lang");
55 $this->assertIsArray($result);
61 $content = [
"acc#:#acc_add_document_btn_label#:#Add Document"];
65 $result = $ilObjLanguageDBAccess->insertLangEntries(
"lang/ilias_en.lang");
67 $this->assertArrayHasKey(
"acc", $result);
68 $this->assertArrayHasKey(
"acc_add_document_btn_label", $result[
"acc"]);
69 $this->assertEquals(
"Add Document", $result[
"acc"][
"acc_add_document_btn_label"]);
75 $content = [
"acc#:#acc_add_document_btn_label#:#Add Document"];
76 $local_changes = [
"acc" => [
"acc_add_document_btn_label" =>
"Add Documents"]];
79 $result = $ilObjLanguageDBAccess->insertLangEntries(
"lang/ilias_en.lang");
81 $this->assertEquals(
"Add Documents", $result[
"acc"][
"acc_add_document_btn_label"]);
87 $content = [
"acc#:#acc_add_document_btn_label#:#Add Document"];
92 $this->ilDB->expects($this->once())->method(
"manipulate");
93 $result = $ilObjLanguageDBAccess->insertLangEntries(
"lang/ilias_en.lang");
99 $content = [
"acc#:#acc_add_document_btn_label#:#Add Document"];
100 $local_changes = [
"acc" => [
"acc_add_document_btn_label" =>
"Add Documents"]];
104 $this->ilDB->expects($this->never())->method(
"manipulate");
105 $result = $ilObjLanguageDBAccess->insertLangEntries(
"lang/ilias_en.lang");
Class ilObjLanguageDBAccessTest.
testInsertLangEntriesManipulateCalledNeverWhenEveryContentHasALocalChange()
testInsertLangEntriesLocalChangesAreNotOverwritten()
testInsertLangEntriesManipulateCalledOnce()
testInsertLangEntriesReturnsArray()
Class ilLanguageBaseTest.
testInsertLangEntriesReturnedArrayHasValuesFromContent()