/**
  * composer.json guard
  */
 public function testWriteComposerGuard()
 {
     $this->creator->writeSupportFiles($this->package, $this->rootdir->url(), true);
     $file = $this->rootdir->url() . '/composer.json';
     $this->assertFileExists($file);
     $composer = json_decode(file_get_contents($file));
     // check package name
     $this->assertEquals($this->package->getFullName(), $composer->name, 'Package name check: ');
     // check authors
     $this->assertCount(1, $composer->authors, 'Authors check: ');
     $this->assertEquals($this->package->author, $composer->authors[0]->name, 'Author name check: ');
     $this->assertEquals($this->package->email, $composer->authors[0]->email, 'Author email check: ');
     // check autoload
     $psr0 = $this->package->vendor . '\\' . $this->package->name;
     $this->objectHasAttribute($psr0, $composer->autoload->{'psr-0'}, 'Autoload - PSR-0 key check: ');
     $this->assertEquals($composer->autoload->{'psr-0'}->{$psr0}, 'src/', 'Autoload - PSR-0 value check: ');
 }