public function setUp()
 {
     $loader = new YamlSpecLoader(new FileLocator(__DIR__ . '/Fixtures/'));
     $this->spec = $loader->loadSpec('spec1');
     $this->formatter = \Mockery::mock('Giftcards\\FixedWidth\\Spec\\ValueFormatter\\ValueFormatterInterface');
     $this->recognizer = \Mockery::mock('Giftcards\\FixedWidth\\Spec\\Recognizer\\RecordSpecRecognizerInterface');
     $this->file = new InMemoryFile($this->getFaker()->word, $this->spec->getWidth());
 }
 /**
  * @expectedException \Giftcards\FixedWidth\Spec\Recognizer\CouldNotRecognizeException
  */
 public function testFailedRecognize()
 {
     $loader = new YamlSpecLoader(new FileLocator(__DIR__ . '/../../Fixtures/'));
     $spec = $loader->loadSpec('field_recognizer');
     $line = new Line(60);
     $line['34:39'] = 'goo';
     $this->assertEquals('record1', $this->recognizer->recognize($line, $spec));
     $line = new Line(60);
     $line['34:41'] = 'bye';
     $this->assertEquals('record2', $this->recognizer->recognize($line, $spec));
 }
Beispiel #3
0
 public function setUp()
 {
     $loader = new YamlSpecLoader(new FileLocator(__DIR__ . '/Fixtures/'));
     $this->spec = $loader->loadSpec('spec1');
     $this->builder = new FileBuilder($this->fileName = $this->getFaker()->word, $this->spec, $this->formatter = \Mockery::mock('Giftcards\\FixedWidth\\Spec\\ValueFormatter\\ValueFormatterInterface'));
 }
Beispiel #4
0
 public function setUp()
 {
     $loader = new YamlSpecLoader(new FileLocator(__DIR__ . '/Fixtures/'));
     $spec = $loader->loadSpec('spec1');
     $this->reader = new LineReader($this->line = new Line($spec->getWidth()), $this->spec = $spec->getRecordSpec('record1'), $this->formatter = \Mockery::mock('Giftcards\\FixedWidth\\Spec\\ValueFormatter\\ValueFormatterInterface'));
 }