Esempio n. 1
0
 /**
  * @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 testHas()
 {
     $this->container->setDefaultFormat('yml')->addPath($this->paths[0])->load('date');
     $this->assertTrue($this->container->has('date'));
 }