| 1 | <?php |
||
| 11 | class PluginTest extends TestCase |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * @var Composer |
||
| 15 | */ |
||
| 16 | private $composer; |
||
| 17 | |||
| 18 | private $io; |
||
| 19 | |||
| 20 | public function setUp() |
||
| 21 | { |
||
| 22 | $this->composer = new Composer(); |
||
| 23 | $this->composer->setConfig(new Config()); |
||
| 24 | $this->composer->setInstallationManager(new InstallationManager()); |
||
| 25 | $this->io = $this->getMock('Composer\IO\IOInterface'); |
||
| 26 | } |
||
| 27 | |||
| 28 | public function testActivateSuccess() |
||
| 29 | { |
||
| 30 | $plugin = new Plugin(); |
||
| 31 | $plugin->activate($this->composer, $this->io); |
||
| 32 | $installer = $this->composer->getInstallationManager()->getInstaller('git-hook'); |
||
| 33 | |||
| 34 | // Check right installer instance is given |
||
| 35 | $this->assertInstanceOf('Ams\Composer\GitHooks\Installer\GitHooksInstaller', $installer); |
||
| 36 | } |
||
| 37 | } |
||
| 38 |