protected function setUp() { parent::setUp(); Route::clear(); $this->path = Path::joinWithTemp(uniqid() . '_generated_uri_helper.js'); Config::overrideProperty("global", "prefix_system")->with("/app"); }
public function setUp() { $this->directory = Path::joinWithTemp('directory_class'); mkdir($this->directory, 0777, true); file_put_contents(Path::join($this->directory, 'file1.txt'), 'test'); file_put_contents(Path::join($this->directory, 'file2.txt'), 'some new file'); }
/** * @test */ public function shouldJoinPathWithTempDirectory() { // given $s = DIRECTORY_SEPARATOR; $tmp = sys_get_temp_dir(); // when $path = Path::joinWithTemp('my/file.txt'); // then $this->assertEquals("{$tmp}{$s}my{$s}file.txt", $path); }
/** * @test */ public function shouldSaveGeneratedUriHelperInFile() { //given Route::resource('users'); $fileName = uniqid() . '_GeneratedUriHelper.php'; $path = Path::joinWithTemp($fileName); $generator = UriHelperGenerator::generate(); //when $generator->saveToFile($path); //then $this->assertFileExists($path); $this->assertEquals($generator->getGeneratedFunctions(), file_get_contents($path)); unlink($path); }
protected function setUp() { parent::setUp(); $this->path = Path::joinWithTemp('users'); }
/** * @test */ public function shouldDeleteFileIfExists() { //given $filePath = Path::joinWithTemp('files_test'); file_put_contents($filePath, 'test'); //when $isDeleted = Files::deleteIfExists($filePath); //then $this->assertTrue($isDeleted); $this->assertFileNotExists($filePath); }
protected function setUp() { parent::setUp(); $this->controllerPath = Path::joinWithTemp('UsersController.php'); }