/**
  * Searchs if the registry has a package with the same name exists with a
  * different camelcase.
  *
  * @param Pool               $pool
  * @param string             $name
  * @param TransportException $ex
  */
 protected function fallbackWathProvides(Pool $pool, $name, TransportException $ex)
 {
     $providers = array();
     if (404 === $ex->getCode() && !$this->fallbackProviders) {
         $this->fallbackProviders = true;
         $repoName = Util::convertAliasName($name);
         $results = $this->search($repoName);
         foreach ($results as $item) {
             if ($name === strtolower($item['name'])) {
                 $providers = $this->whatProvides($pool, $item['name']);
                 break;
             }
         }
     }
     $this->fallbackProviders = false;
     $this->providers[$name] = $providers;
 }
Exemplo n.º 2
0
 /**
  * @dataProvider getPackageNames
  *
  * @param string $name
  * @param string $validName
  */
 public function testConvertAliasName($name, $validName)
 {
     $this->assertSame($validName, Util::convertAliasName($name));
 }