Skip to content

Commit

Permalink
FIX: Add missing methods to plugin interface
Browse files Browse the repository at this point in the history
In the original composer2 fix, these were missed. Funnily enough, our
test suite didn’t cover even this case so I’ve added a minimal failing
test that checks instantiation works.
  • Loading branch information
Sam Minnee authored and Garion Herman committed Oct 26, 2020
1 parent f29fb9e commit 6a15370
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/VendorPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -248,4 +248,18 @@ protected function installLibrary(IOInterface $IO, Library $library)
);
$task->process($IO, [$library]);
}

/**
* Required by the composer 2 plugin interface
*/
public function deactivate(Composer $composer, IOInterface $io)
{
}

/**
* Required by the composer 2 plugin interface
*/
public function uninstall(Composer $composer, IOInterface $io)
{
}
}
17 changes: 17 additions & 0 deletions tests/VendorPluginTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

namespace SilverStripe\VendorPlugin\Tests;

use PHPUnit\Framework\TestCase;
use SilverStripe\VendorPlugin\VendorPlugin;

class VendorPluginTest extends TestCase
{
/**
* The simplest possible test, check that the plugin can be instantiated
*/
public function testInstantiation(): void
{
new VendorPlugin();
}
}

0 comments on commit 6a15370

Please sign in to comment.