3declare(strict_types=1);
 
   25use PHPUnit\Framework\TestCase;
 
   32            public function _getDataDirectoryPath()
 
   34                return $this->getDataDirectoryPath();
 
   41        $this->assertIsString($this->o->getHash());
 
   46        $this->assertIsString($this->o->getLabel());
 
   51        $this->assertFalse($this->o->isNotable());
 
   56        $env = $this->createMock(Setup\Environment::class);
 
   58        $pre = $this->o->getPreconditions($env);
 
   59        $this->assertEquals([], $pre);
 
   64        $env = $this->createMock(Setup\Environment::class);
 
   66        $mock = $this->getMockBuilder(ClientIdReadObjective::class)
 
   67            ->onlyMethods([
"getDataDirectoryPath", 
"scanDirectory", 
"isDirectory"])
 
   70        $DATA_DIR = 
"/foo/bar/data";
 
   71        $SOME_DIR = 
"clientid";
 
   72        $SOME_FILE = 
"some_file";
 
   73        $SCAN_RESULT = [
".", 
"..", $SOME_DIR, $SOME_FILE];
 
   76            ->expects($this->once())
 
   77            ->method(
"getDataDirectoryPath")
 
   78            ->willReturn($DATA_DIR);
 
   81            ->expects($this->once())
 
   82            ->method(
"scanDirectory")
 
   84            ->willReturn($SCAN_RESULT);
 
   87            ->expects($this->exactly(2))
 
   88            ->method(
"isDirectory")
 
   89            ->withConsecutive([$DATA_DIR . 
"/" . $SOME_DIR], [$DATA_DIR . 
"/" . $SOME_FILE])
 
   90            ->will($this->onConsecutiveCalls(
true, 
false));
 
   93            ->expects($this->once())
 
   94            ->method(
"withResource")
 
   98        $res = $mock->achieve($env);
 
   99        $this->assertSame($env, 
$res);
 
  104        $base = dirname(__DIR__, 3);
 
  105        $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...