Ejemplo n.º 1
0
 public function testHasPackage()
 {
     $arrayRepoOne = new ArrayRepository();
     $arrayRepoOne->addPackage($this->getPackage('foo', '1'));
     $arrayRepoTwo = new ArrayRepository();
     $arrayRepoTwo->addPackage($this->getPackage('bar', '1'));
     $repo = new CompositeRepository(array($arrayRepoOne, $arrayRepoTwo));
     $this->assertTrue($repo->hasPackage($this->getPackage('foo', '1')), "Should have package 'foo/1'");
     $this->assertTrue($repo->hasPackage($this->getPackage('bar', '1')), "Should have package 'bar/1'");
     $this->assertFalse($repo->hasPackage($this->getPackage('foo', '2')), "Should not have package 'foo/2'");
     $this->assertFalse($repo->hasPackage($this->getPackage('bar', '2')), "Should not have package 'bar/2'");
 }