Populate more of the test stub
This commit is contained in:
parent
ea2f5a4ae8
commit
0d6bd4e070
|
@ -1,5 +1,21 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Drupal\{{ name }}\Tests\Functional;
|
namespace Drupal\{{ machine_name }}\Tests\Functional;
|
||||||
|
|
||||||
final class {{ test_name }} extends \DrupalWebTestCase {}
|
final class {{ test_name }} extends \DrupalWebTestCase {
|
||||||
|
|
||||||
|
public static function getInfo() {
|
||||||
|
return array(
|
||||||
|
'name' => '{{ name }}',
|
||||||
|
'description' => '{{ name }} tests.',
|
||||||
|
'group' => '{{ name }}',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function test_that_the_front_page_loads() {
|
||||||
|
$this->drupalGet('<front>');
|
||||||
|
|
||||||
|
$this->assertResponse(200);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -120,6 +120,7 @@ final class GenerateDrupal7Command extends Command
|
||||||
|
|
||||||
private function updateFileContents($contents)
|
private function updateFileContents($contents)
|
||||||
{
|
{
|
||||||
|
$contents = str_replace('{{ machine_name }}', $this->machineName, $contents);
|
||||||
$contents = str_replace('{{ name }}', $this->moduleName, $contents);
|
$contents = str_replace('{{ name }}', $this->moduleName, $contents);
|
||||||
$contents = str_replace('{{ test_name }}', $this->testName, $contents);
|
$contents = str_replace('{{ test_name }}', $this->testName, $contents);
|
||||||
|
|
||||||
|
|
|
@ -109,6 +109,12 @@ final class GenerateDrupal7ModuleCommandTest extends TestCase
|
||||||
|
|
||||||
$contents = file_get_contents('test_module/src/Tests/Functional/TestModuleTest.php');
|
$contents = file_get_contents('test_module/src/Tests/Functional/TestModuleTest.php');
|
||||||
|
|
||||||
|
$this->assertStringContainsString('namespace Drupal\\test_module\\Tests\\Functional', $contents);
|
||||||
|
|
||||||
$this->assertStringContainsString('final class TestModuleTest', $contents);
|
$this->assertStringContainsString('final class TestModuleTest', $contents);
|
||||||
|
|
||||||
|
$this->assertStringContainsString("'name' => 'Test Module'", $contents);
|
||||||
|
$this->assertStringContainsString("'description' => 'Test Module tests.'", $contents);
|
||||||
|
$this->assertStringContainsString("'group' => 'Test Module'", $contents);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue