public function testParseLine() { $this->line['34:39'] = 'seeya'; $this->line['40:42'] = 'ho'; $this->formatter->shouldReceive('formatFromFile')->once()->with($this->spec->getFieldSpec('field2'), 'ho')->andReturn('ha')->getMock()->shouldReceive('formatFromFile')->once()->with($this->spec->getFieldSpec('field1'), 'seeya')->andReturn('booya')->getMock(); $this->assertEquals(array('field1' => 'booya', 'field2' => 'ha'), $this->reader->getFields()); }
/** * @expectedException \Giftcards\FixedWidth\Spec\SpecNotFoundException */ public function testGetFieldSpecWhereNotThere() { $spec = new RecordSpec($this->getFaker()->word, array()); $spec->getFieldSpec('field1'); }