3 declare(strict_types=1);
34 public function _getDataDirectoryPath()
36 return $this->getDataDirectoryPath();
43 $this->assertIsString($this->o->getHash());
48 $this->assertIsString($this->o->getLabel());
53 $this->assertFalse($this->o->isNotable());
58 $env = $this->createMock(Setup\Environment::class);
60 $pre = $this->o->getPreconditions($env);
61 $this->assertEquals([], $pre);
66 $env = $this->createMock(Setup\Environment::class);
68 $mock = $this->getMockBuilder(ClientIdReadObjective::class)
69 ->onlyMethods([
"getDataDirectoryPath",
"scanDirectory",
"isDirectory"])
72 $DATA_DIR =
"/foo/bar/data";
73 $SOME_DIR =
"clientid";
74 $SOME_FILE =
"some_file";
75 $SCAN_RESULT = [
".",
"..", $SOME_DIR, $SOME_FILE];
78 ->expects($this->once())
79 ->method(
"getDataDirectoryPath")
80 ->willReturn($DATA_DIR);
83 ->expects($this->once())
84 ->method(
"scanDirectory")
86 ->willReturn($SCAN_RESULT);
89 ->expects($this->exactly(2))
90 ->method(
"isDirectory")
91 ->withConsecutive([$DATA_DIR .
"/" . $SOME_DIR], [$DATA_DIR .
"/" . $SOME_FILE])
92 ->will($this->onConsecutiveCalls(
true,
false));
95 ->expects($this->once())
96 ->method(
"withResource")
100 $res = $mock->achieve($env);
101 $this->assertSame($env,
$res);
106 $base = dirname(__DIR__, 3);
107 $this->assertEquals($base .
"/data", $this->o->_getDataDirectoryPath());
Read the client id of the installation from the data directory.
testGetDataDirectoryPath()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...