/**
  * @override
  */
 protected function doLoad($file)
 {
     $data = parent::doLoad($file);
     if (isset($data['parameters'])) {
         foreach ($data['parameters'] as $parameter => $value) {
             $this->app[$parameter] = $value;
         }
     }
     return $data;
 }
Esempio n. 2
0
 protected function setUp()
 {
     $this->cache = $this->createDir();
     $this->dir = $this->createDir();
     $this->collector = new ResourceCollector();
     $this->loader = new PhpFileLoader(new FileLocator($this->dir));
     $this->processor = new TestProcessor();
     $this->wise = new Wise(true);
     $this->loader->setResourceCollector($this->collector);
 }
    public function testDoLoad()
    {
        file_put_contents("{$this->dir}/test.php", <<<DATA
<?php return array(
    'imports' => array(
        array('resource' => 'import.php')
    ),
    'root' => array(
        'number' => 123,
        'imported' => '%imported.value%'
    )
);
DATA
);
        file_put_contents("{$this->dir}/import.php", <<<DATA
<?php return array(
    'imported' => array(
        'value' => 'imported value'
    )
);
DATA
);
        $this->assertSame(array('imported' => array('value' => 'imported value'), 'imports' => array(array('resource' => 'import.php')), 'root' => array('number' => 123, 'imported' => 'imported value')), $this->loader->load('test.php'));
    }