Author: Nicola Pietroluongo (nik.longstone@gmail.com)
 public function testAddMethod()
 {
     $container = new FakeFileContainer();
     $file = new File($this->filePath);
     $container->add('file', $file);
     $this->assertInstanceOf('\\SplFileInfo', $container->get($this->filePath));
 }
 public function testAddMethod()
 {
     $container = new FakeFileContainer();
     $fileDir = __DIR__ . '/../Fixtures/';
     $file = new File($fileDir . 'file.txt');
     $container->add('file', $file);
     $this->assertInstanceOf('\\SplFileInfo', $container->get('file', ''));
 }
 /**
  * {@inheritdoc}
  */
 public function generate()
 {
     if ($fakeFile = FakeFileContainer::get($this->caller->getOption('filename'))) {
         $lines = file($fakeFile);
         $index = mt_rand(0, count($lines) - 1);
         $element = $lines[$index];
         return preg_replace("/\r|\n/", "", $element);
     } else {
         return;
     }
 }