Exemple #1
0
 public function testSetReferencesClearsAndSetsReferences()
 {
     $res = $this->loadData(array(self::USER => array('bob' => array(), 'jim' => array())));
     $this->loader->setReferences(array('bob' => new User()));
     $references = $this->loader->getReferences();
     $this->assertNotSame($res['bob'], $references['bob']);
     $this->assertNotContains($res['jim'], $references);
     $this->assertCount(1, $references);
 }
Exemple #2
0
 public function testYamlArrayParametersAreProperlyInterpreted()
 {
     $res = $this->createLoader()->load(__DIR__ . '/../support/fixtures/array_parameters.yml');
     $this->assertCount(5, $res);
     foreach ($this->loader->getReferences() as $user) {
         $this->assertInstanceOf(self::USER, $user);
         $this->assertContains($user->username, ['Alice', 'Bob', 'Ogi']);
     }
 }