Esempio n. 1
0
 public function toTestCrossVolumeRename(CliGuy $I)
 {
     $fsStack = $I->taskFilesystemStack()->mkdir('log')->touch('log/error.txt');
     $fsStack->run();
     // We can't force _rename to run the cross-volume
     // code path, so we will directly call the protected
     // method crossVolumeRename to test to ensure it works.
     // We will get a reference to it via reflection, set
     // the reflected method object to public, and then
     // call it via reflection.
     $class = new ReflectionClass('\\Robo\\Task\\Filesystem\\FilesystemStack');
     $method = $class->getMethod('crossVolumeRename');
     $method->setAccessible(true);
     $actualFsStackTask = $fsStack->getCollectionBuilderCurrentTask();
     $method->invokeArgs($actualFsStackTask, ['log', 'logfiles']);
     $I->dontSeeFileFound('log/error.txt');
     $I->seeFileFound('logfiles/error.txt');
 }