ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
LanguageFolderLegacyProxyTest.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
24{
26 {
27 $queried = false;
28 $db = $this->createStub(ilDBInterface::class);
29 $db->method('quote')->willReturn("'lngf'");
30 $db->method('query')->willReturnCallback(function () use (&$queried): ilDBStatement {
31 $queried = true;
32 return $this->createStub(ilDBStatement::class);
33 });
34 $db->method('fetchAssoc')->willReturn(['ref_id' => '42']);
35 $GLOBALS['DIC']['ilDB'] = $db;
36
37 $proxy = new LanguageFolderLegacyProxy();
38 self::assertFalse($queried);
39
40 self::assertSame(42, $proxy->getRefId());
41 self::assertTrue($queried);
42 }
43}
Looks the ref_id up on every call, so it can be built at build time without database access.
Class ilLanguageBaseTest.
Interface ilDBStatement.
$GLOBALS["DIC"]
Definition: wac.php:66