Ejemplo n.º 1
0
 /**
  * Template method. Extract dependencies step
  *
  * @param Package $package
  * @return array
  */
 protected function extractDependencies($package)
 {
     $dependencies = [];
     $requires = $package->get('require', '/.+\\/module-/');
     if ($requires) {
         foreach ($requires as $key => $value) {
             $dependencies[] = ['module' => $this->prepareModuleName($key), 'type' => 'hard'];
         }
     }
     $suggests = $package->get('suggest', '/.+\\/module-/');
     if ($suggests) {
         foreach ($suggests as $key => $value) {
             $dependencies[] = ['module' => $this->prepareModuleName($key), 'type' => 'soft'];
         }
     }
     return $dependencies;
 }
Ejemplo n.º 2
0
 public function testGet()
 {
     $this->assertSame('1', $this->object->get('foo'));
     $this->assertSame(['3', '4'], $this->object->get('baz'));
     $nested = $this->object->get('nested');
     $this->assertInstanceOf('\\StdClass', $nested);
     $this->assertObjectHasAttribute('one', $nested);
     $this->assertEquals('5', $nested->one);
     $this->assertEquals('5', $this->object->get('nested->one'));
     $this->assertObjectHasAttribute('two', $nested);
     $this->assertEquals('6', $nested->two);
     $this->assertEquals('6', $this->object->get('nested->two'));
     $this->assertEquals(['magento/theme-adminhtml-backend' => 7, 'magento/theme-frontend-luma' => 8], (array) $this->object->get('nested', '/^magento\\/theme/'));
 }