Exemple #1
0
 /**
  * @test
  */
 public function shouldAcceptEmptyJson()
 {
     //given
     StreamStub::register('json');
     StreamStub::$body = '';
     ContentType::set('application/json');
     //when
     $parameters = $this->getRequestParameters('json://input');
     //then
     ArrayAssert::that($parameters)->hasSize(0);
     StreamStub::unregister();
 }
 protected function tearDown()
 {
     Config::clearProperty('logger', 'default', 'minimal_levels');
     StreamStub::unregister();
     parent::tearDown();
 }
Exemple #3
0
 /**
  * @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);
 }