$this->
assertTrue($loader->
supports('foo.yml', 'yaml'
), '->supports() checks the resource type if specified'
);
$this->
assertTrue($loader->
supports('foo.yaml', 'yaml'
), '->supports() checks the resource type if specified'
);
$this->
assertFalse($loader->
supports('foo.yml', 'foo'
), '->supports() checks the resource type if specified'
);
} public function testLoadDoesNothingIfEmpty() { $loader =
new YamlFileLoader(new FileLocator([__DIR__.'/../Fixtures'
]));
$collection =
$loader->
load('empty.yml'
);
$this->
assertEquals([],
$collection->
all());
$this->
assertEquals([new FileResource(realpath(__DIR__.'/../Fixtures/empty.yml'
))],
$collection->
getResources());
} /**
* @dataProvider getPathsToInvalidFiles
*/
public function testLoadThrowsExceptionWithInvalidFile($filePath) { $this->
expectException(\InvalidArgumentException::
class);
$loader =
new YamlFileLoader(new FileLocator([__DIR__.'/../Fixtures'
]));
$loader->
load($filePath);
}