public function testLoader()
{
$gherkin = new Gherkin();
$gherkin->addLoader($loader = $this->getLoaderMock());
$gherkin->addFilter($nameFilter = $this->getNameFilterMock());
$gherkin->addFilter($tagFilter = $this->getTagFilterMock());
$feature = new FeatureNode();
$feature->addScenario($scenario = new ScenarioNode());
$loader->expects($this->once())->method('supports')->with($resource = 'some/feature/resource')->will($this->returnValue(true));
$loader->expects($this->once())->method('load')->with($resource)->will($this->returnValue(array($feature)));
$nameFilter->expects($this->once())->method('isScenarioMatch')->with($scenario)->will($this->returnValue(true));
$tagFilter->expects($this->once())->method('isScenarioMatch')->with($scenario)->will($this->returnValue(true));
$features = $gherkin->load($resource);
$this->assertEquals(1, count($features));
$scenarios = $features[0]->getScenarios();
$this->assertEquals(1, count($scenarios));
$this->assertSame($scenario, $scenarios[0]);
}