for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace SmartWeb\ModuleTesting\Generator\Test;
use SmartWeb\ModuleTesting\Codeception\SetupInterface;
use function class_basename;
/**
* Class TestGenerator
*
* @package SmartWeb\ModuleTesting\Generator\Test
*/
class TestGenerator extends BaseTestGenerator
{
* TestGenerator constructor.
* @param SetupInterface $setup
* @param string $suite
* @param string $name
* @param array $settings
* @throws \Exception
public function __construct(SetupInterface $setup, string $suite, string $name, array $settings = [])
parent::__construct(CodeceptionTestType::test(), $setup, $suite, $name, $settings);
}
* @inheritDoc
protected function getBaseSettings() : array
$suiteSettings = $this->getSuiteSettings($this->suite);
$moduleSettings = $this->getSettingsForModule();
$baseSettings = [
'namespace' => $suiteSettings['namespace'],
'baseClass' => $this->getBaseClass(),
'baseClassShort' => class_basename($this->getBaseClass()),
'name' => class_basename($this->name),
'group' => 'exampleGroup',
];
$actor = ($suiteSettings['actor'] ?? $moduleSettings['actor']) ?? 'Tester';
$baseSettings['actorClass'] = $this->suite . '\\' . $actor;
return $baseSettings;