/** * Constructor * * @param array $resourcePaths * @param string $fileExtension */ public function __construct(array $resourcePaths = [], $fileExtension) { $this->container = new Container(); $this->container->addPaths($resourcePaths)->setDefaultFormat($fileExtension); $this->resourcePath = $resourcePaths; $this->setList(); }
/** * @param string $deckName * @param array $paths * @throws TarotException */ public function __construct($deckName, array $paths = []) { $container = new Container(); $container->setDefaultFormat('json')->addPath(__DIR__ . '/../resources/'); $paths and $container->addPaths($paths); $data = $container->load($deckName); if (!isset($data['cards']) or !isset($data['groups'])) { throw new TarotException('Content errors!'); } $this->cards = $data['cards']; $this->groups = $data['groups']; }
public function testRemovePaths() { $this->container->addPaths($this->paths)->removePaths($this->paths); $this->assertCount(0, $this->container->getPaths()); }