-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests, remove hook functionality
At some point, we might add hooks again with a better consideration on how to actually add them in a sustainable way. Adding templates manually is not going to scale.
- Loading branch information
Showing
5 changed files
with
151 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
use MWStew\Builder\ExtensionDetails; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
class ExtensionDetailsTest extends TestCase { | ||
public function testGetters() { | ||
$data = [ | ||
'name' => 'FooBar', | ||
'title' => 'Foo bar', | ||
'author' => 'Moe Schmoe', | ||
'version' => '1.2.3', | ||
'description' => 'A test description', | ||
'url' => 'http://www.example.com/foobar', | ||
'license' => 'MIT', | ||
'dev_php' => true, | ||
'dev_js' => true, | ||
'specialpage_name' => 'Foobar', | ||
'specialpage_title' => 'Get the foobar', | ||
'specialpage_intro' => 'A great new special foobar page.' | ||
]; | ||
|
||
$details = new ExtensionDetails( $data ); | ||
|
||
$this->assertEquals( 'FooBar', $details->getName() ); | ||
$this->assertEquals( 'fooBar', $details->getLowerCamelName() ); | ||
$this->assertEquals( 'FooBar', $details->getClassName() ); | ||
$this->assertEquals( true, $details->isEnvironment( 'js' ) ); | ||
$this->assertEquals( true, $details->isEnvironment( 'php' ) ); | ||
$this->assertEquals( 'MIT', $details->getLicense() ); | ||
$this->assertEquals( true, $details->hasSpecialPage() ); | ||
$this->assertEquals( 'SpecialFoobar', $details->getSpecialPageClassName() ); | ||
$this->assertEquals( 'special-foobar', $details->getSpecialPageKeyFormat() ); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters