protected function tearDown() { if (Files::exists($this->controllerPath)) { Files::delete($this->controllerPath); } parent::tearDown(); }
/** * @test */ public function shouldCopyFileContent() { //given StreamStub::register('logfile'); StreamStub::$body = 'content'; $tmpFileName = Path::joinWithTemp('test' . Clock::nowAsString('Y_m_d_H_i_s') . '.txt'); //when Files::copyContent('logfile://input', $tmpFileName); //then $content = file_get_contents($tmpFileName); StreamStub::unregister(); Files::delete($tmpFileName); $this->assertEquals('content', $content); }