Esempio n. 1
0
 protected function setUp()
 {
     parent::setUp();
     Clock::freeze('2014-01-01 11:11:11');
     StreamStub::register('test');
     $this->logger = new StdOutputLogger('TEST', 'default', 'test');
 }
Esempio n. 2
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();
 }
Esempio n. 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);
 }