コード例 #1
0
 public function testPackagePsr0()
 {
     $files = $this->getComposerFiles();
     $composer = $this->helper->getJSON($files['newpackage']);
     $psr0 = $this->newpackage->psr0;
     $this->assertTrue(isset($composer->autoload->{"psr-0"}->{$psr0}));
     $this->assertEquals('src/', $composer->autoload->{"psr-0"}->{$psr0});
 }
コード例 #2
0
 public function testComposerFileWithPsr0AndNsOption()
 {
     $namespace = $this->meta['namespace'] . '\\\\' . $this->meta['vendor'];
     $this->getCommand()->execute(array('package' => $this->meta['package'], '--psr0' => $this->meta['vendor'], '--ns' => $namespace));
     $path = $this->app['path.base'] . '/workbench/' . $this->meta['package'];
     $composerfile = $path . '/composer.json';
     $this->assertFileExists($composerfile);
     $composer = $this->helper->getJSON($composerfile);
     // check autoload psr-0
     $this->objectHasAttribute($this->meta['vendor'], $composer->autoload->{'psr-0'}, 'Autoload - PSR-0 key check: ');
     $this->assertEquals($composer->autoload->{'psr-0'}->{$this->meta['vendor']}, 'src/', 'Autoload - PSR-0 value check: ');
 }