コード例 #1
0
 /**
  * @dataProvider repositoryDataProvider
  * @param string $url
  * @param array $expectedPackages
  */
 public function testRepositoryRead($url, array $expectedPackages)
 {
     $repoConfig = array('url' => $url);
     $this->createRepository($repoConfig);
     foreach ($expectedPackages as $expectedPackage) {
         $this->assertInstanceOf('Composer\\Package\\PackageInterface', $this->repository->findPackage($expectedPackage['name'], $expectedPackage['version']), 'Expected package ' . $expectedPackage['name'] . ', version ' . $expectedPackage['version'] . ' not found in pear channel ' . $url);
     }
 }
コード例 #2
0
 /**
  * @dataProvider repositoryDataProvider
  * @param string $url
  * @param array  $expectedPackages
  */
 public function testRepositoryRead($url, array $expectedPackages)
 {
     $repoConfig = array('url' => $url);
     if (!@file_get_contents('http://' . $url)) {
         $this->markTestSkipped('Repository ' . $url . ' appears to be unreachable');
     }
     $this->createRepository($repoConfig);
     foreach ($expectedPackages as $expectedPackage) {
         $this->assertInstanceOf('Composer\\Package\\PackageInterface', $this->repository->findPackage($expectedPackage['name'], $expectedPackage['version']), 'Expected package ' . $expectedPackage['name'] . ', version ' . $expectedPackage['version'] . ' not found in pear channel ' . $url);
     }
 }