Skip to content

Commit

Permalink
Maintanance
Browse files Browse the repository at this point in the history
* fixed codestyle
* updated codeception/base release script
* updated changelog
* version bump
  • Loading branch information
DavertMik committed Jul 24, 2016
1 parent 34c268a commit e45ca52
Show file tree
Hide file tree
Showing 71 changed files with 109 additions and 128 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* added `seeEmailIsSent`, `grabLastSentEmail`, etc and email part.
* assetManager disabled for unit/functional tests.
* Fixed `@example` to `@group` defined in group files. By @eXorus. Fixes #3278
* Added `ReqiuiresPackage` interface to set external dependencies for modules.
* Fixed timing values in output. Closes #3331
* Fixed merging module configs. Closes #3292
* [Recorder Extension] Fixes saving of files on windows and with using examples.
Expand Down
22 changes: 12 additions & 10 deletions RoboFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function release()
$this->revertComposerJsonChanges();
$this->publishPhar();
$this->publishGit();
$this->publishBase();
$this->publishBase(null, \Codeception\Codecept::VERSION);
$this->versionBump();
}

Expand Down Expand Up @@ -132,7 +132,6 @@ public function testLaunchServer($pathToSelenium = '~/selenium-server.jar ')
$this->taskServer(8000)
->dir('tests/data/app')
->run();

}

public function testCli()
Expand Down Expand Up @@ -299,12 +298,16 @@ public function buildDocsModules()
->prepend('# '.$moduleName)
->append('<p>&nbsp;</p><div class="alert alert-warning">Module reference is taken from the source code. <a href="'.$source.'">Help us to improve documentation. Edit module reference</a></div>')
->processClassSignature(false)
->processClassDocBlock(function(\ReflectionClass $c, $text) {
return "$text\n\n## Actions";
->processClassDocBlock(function (\ReflectionClass $c, $text) {
return "$text\n\n## Actions";
})->processProperty(false)
->filterMethods(function(\ReflectionMethod $method) use ($className) {
if ($method->isConstructor() or $method->isDestructor()) return false;
if (!$method->isPublic()) return false;
->filterMethods(function (\ReflectionMethod $method) use ($className) {
if ($method->isConstructor() or $method->isDestructor()) {
return false;
}
if (!$method->isPublic()) {
return false;
}
if (strpos($method->name, '_') === 0) {
$doc = $method->getDocComment();
try {
Expand Down Expand Up @@ -362,9 +365,9 @@ public function buildDocsUtils()
)
->processClassDocBlock(function (ReflectionClass $r, $text) {
return $text . "\n";
})->processMethodSignature(function(ReflectionMethod $r, $text) {
})->processMethodSignature(function (ReflectionMethod $r, $text) {
return '### ' . $r->getName();
})->processMethodDocBlock(function(ReflectionMethod $r, $text) use ($utilName, $source) {
})->processMethodDocBlock(function (ReflectionMethod $r, $text) use ($utilName, $source) {
$line = $r->getStartLine();
if ($r->isStatic()) {
$text = "\n*static*\n$text";
Expand Down Expand Up @@ -399,7 +402,6 @@ public function buildDocsCommands()
return false;
})
->run();

}

public function buildDocsExtensions()
Expand Down
1 change: 0 additions & 1 deletion ext/Recorder.php
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,6 @@ public function afterSuite()

file_put_contents(codecept_output_dir().'records.html', $indexHTML);
$this->writeln("⏺ Records saved into: <info>file://" . codecept_output_dir().'records.html</info>');

}

public function before(TestEvent $e)
Expand Down
2 changes: 1 addition & 1 deletion package/stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@

require_once 'phar://codecept.phar/codecept';

__HALT_COMPILER();
__halt_compiler();
2 changes: 1 addition & 1 deletion src/Codeception/Codecept.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

class Codecept
{
const VERSION = "2.2.3";
const VERSION = "2.2.4";

/**
* @var \Codeception\PHPUnit\Runner
Expand Down
4 changes: 2 additions & 2 deletions src/Codeception/Command/DryRun.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function execute(InputInterface $input, OutputInterface $output)
$suite = $input->getArgument('suite');
$test = $input->getArgument('test');

$config = Configuration::config( $input->getOption('config'));
$config = Configuration::config($input->getOption('config'));
if (! Configuration::isEmpty() && ! $test && strpos($suite, $config['paths']['tests']) === 0) {
list(, $suite, $test) = $this->matchTestFromFilename($suite, $config['paths']['tests']);
}
Expand Down Expand Up @@ -133,4 +133,4 @@ protected function dryRunTest(OutputInterface $output, EventDispatcher $dispatch
}
$output->writeln('');
}
}
}
11 changes: 7 additions & 4 deletions src/Codeception/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,13 @@ public static function config($configFile = null)
$tempConfig = self::$defaultConfig;

$distConfigContents = "";
if(file_exists($configDistFile)) {
if (file_exists($configDistFile)) {
$distConfigContents = file_get_contents($configDistFile);
$tempConfig = self::mergeConfigs($tempConfig, self::getConfFromContents($distConfigContents));
}

$configContents = "";
if(file_exists($configFile)) {
if (file_exists($configFile)) {
$configContents = file_get_contents($configFile);
$tempConfig = self::mergeConfigs($tempConfig, self::getConfFromContents($configContents));
}
Expand Down Expand Up @@ -405,8 +405,11 @@ public static function modules($settings)
array_map(
function ($m) {
return is_array($m) ? key($m) : $m;
}, $settings['modules']['enabled'], array_keys($settings['modules']['enabled']))
, function ($m) use ($settings) {
},
$settings['modules']['enabled'],
array_keys($settings['modules']['enabled'])
),
function ($m) use ($settings) {
if (!isset($settings['modules']['disabled'])) {
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Codeception/Exception/Fail.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
class Fail extends \PHPUnit_Framework_AssertionFailedError
{

}
}
2 changes: 1 addition & 1 deletion src/Codeception/Exception/Incomplete.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
class Incomplete extends \PHPUnit_Framework_IncompleteTestError
{

}
}
2 changes: 1 addition & 1 deletion src/Codeception/Exception/Skip.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
class Skip extends \PHPUnit_Framework_SkippedTestError
{

}
}
1 change: 0 additions & 1 deletion src/Codeception/Lib/Connector/Yii1.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,5 +144,4 @@ public function getHeaders()
{
return $this->headers;
}

}
1 change: 0 additions & 1 deletion src/Codeception/Lib/Connector/Yii2.php
Original file line number Diff line number Diff line change
Expand Up @@ -254,5 +254,4 @@ private function mockAssetManager()
{
$this->app->set('assetManager', Stub::make('yii\web\AssetManager'));
}

}
2 changes: 1 addition & 1 deletion src/Codeception/Lib/Generator/GherkinSnippets.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public function addSnippet(StepNode $step)
$pattern = str_replace('"'.$param.'"', ":arg$num", $pattern);
}
}
if (in_array($pattern, $this->processed)) {
if (in_array($pattern, $this->processed)) {
return;
}

Expand Down
2 changes: 1 addition & 1 deletion src/Codeception/Module/DataFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ public function _beforeSuite($settings = [])
if ($realpath === false) {
throw new ModuleException($this, 'The path to one of your factories is not correct. Please specify the directory relative to the codeception.yml file (ie. _support/factories).');
}
$this->factoryMuffin->loadFactories($realpath);
$this->factoryMuffin->loadFactories($realpath);
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/Codeception/Module/Laravel5.php
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,7 @@ public function seeRecord($table, $attributes = [])
if (! $this->findModel($table, $attributes)) {
$this->fail("Could not find $table with " . json_encode($attributes));
}
} else if (! $this->findRecord($table, $attributes)) {
} elseif (! $this->findRecord($table, $attributes)) {
$this->fail("Could not find matching record in table '$table'");
}
}
Expand All @@ -965,7 +965,7 @@ public function dontSeeRecord($table, $attributes = [])
if ($this->findModel($table, $attributes)) {
$this->fail("Unexpectedly found matching $table with " . json_encode($attributes));
}
} else if ($this->findRecord($table, $attributes)) {
} elseif ($this->findRecord($table, $attributes)) {
$this->fail("Unexpectedly found matching record in table '$table'");
}
}
Expand Down Expand Up @@ -1064,7 +1064,7 @@ public function have($model, $attributes = [], $name = 'default')
{
try {
return $this->modelFactory($model, $name)->create($attributes);
} catch(\Exception $e) {
} catch (\Exception $e) {
$this->fail("Could not create model: \n\n" . get_class($e) . "\n\n" . $e->getMessage());
}
}
Expand Down Expand Up @@ -1093,7 +1093,7 @@ public function haveMultiple($model, $times, $attributes = [], $name = 'default'
{
try {
return $this->modelFactory($model, $name, $times)->create($attributes);
} catch(\Exception $e) {
} catch (\Exception $e) {
$this->fail("Could not create model: \n\n" . get_class($e) . "\n\n" . $e->getMessage());
}
}
Expand Down
5 changes: 2 additions & 3 deletions src/Codeception/Module/Lumen.php
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ public function seeRecord($table, $attributes = [])
if (! $this->findModel($table, $attributes)) {
$this->fail("Could not find $table with " . json_encode($attributes));
}
} else if (! $this->findRecord($table, $attributes)) {
} elseif (! $this->findRecord($table, $attributes)) {
$this->fail("Could not find matching record in table '$table'");
}
}
Expand All @@ -455,7 +455,7 @@ public function dontSeeRecord($table, $attributes = [])
if ($this->findModel($table, $attributes)) {
$this->fail("Unexpectedly found matching $table with " . json_encode($attributes));
}
} else if ($this->findRecord($table, $attributes)) {
} elseif ($this->findRecord($table, $attributes)) {
$this->fail("Unexpectedly found matching record in table '$table'");
}
}
Expand Down Expand Up @@ -530,5 +530,4 @@ protected function findRecord($table, $attributes = [])

return (array) $query->first();
}

}
8 changes: 4 additions & 4 deletions src/Codeception/Module/Symfony.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@
* * client - current Crawler instance
*
* ## Parts
*
*
* * services - allows to use Symfony DIC only with WebDriver or PhpBrowser modules.
*
*
* Usage example:
*
* ```yaml
Expand Down Expand Up @@ -135,7 +135,8 @@ public function _initialize()
{
$cache = Configuration::projectDir() . $this->config['var_path'] . DIRECTORY_SEPARATOR . 'bootstrap.php.cache';
if (!file_exists($cache)) {
throw new ModuleRequireException(__CLASS__,
throw new ModuleRequireException(
__CLASS__,
"Symfony bootstrap file not found in $cache\n \n" .
"Please specify path to bootstrap file using `var_path` config option\n \n" .
"If you are trying to load bootstrap from a Bundle provide path like:\n \n" .
Expand Down Expand Up @@ -350,7 +351,6 @@ public function seeCurrentRouteIs($routeName, array $params = [])
$intersection = array_intersect_assoc($expected, $match);

$this->assertEquals($expected, $intersection);

}

/**
Expand Down
3 changes: 2 additions & 1 deletion src/Codeception/Module/Yii2.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,8 @@ public function haveFixtures($fixtures)
*/
public function grabFixtures()
{
return call_user_func_array('array_merge',
return call_user_func_array(
'array_merge',
array_map( // merge all fixtures from all fixture stores
function ($fixturesStore) {
return $fixturesStore->getFixtures();
Expand Down
2 changes: 1 addition & 1 deletion src/Codeception/Step.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public function getArgumentsAsString($maxLength = 200)

if ($totalLength > $maxLength) {
//sort arguments from shortest to longest
uasort($arguments, function($arg1, $arg2) {
uasort($arguments, function ($arg1, $arg2) {
$length1 = mb_strlen($arg1, 'utf-8');
$length2 = mb_strlen($arg2, 'utf-8');
if ($length1 === $length2) {
Expand Down
2 changes: 1 addition & 1 deletion src/Codeception/Subscriber/Console.php
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ protected function writeTimeInformation(TestEvent $event)
$time = $event->getTime();
if ($time) {
$this
->message(number_format(round($time, 2),2))
->message(number_format(round($time, 2), 2))
->prepend('(')
->append('s)')
->style('info')
Expand Down
3 changes: 1 addition & 2 deletions src/Codeception/Subscriber/Dependencies.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,4 @@ public function testSuccess(TestEvent $event)
}
$this->successfulTests[] = Descriptor::getTestSignature($test);
}

}
}
4 changes: 2 additions & 2 deletions src/Codeception/Test/Cest.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ protected function invoke($methodName, array $context)
}
protected function executeTestMethod($I)
{
if (!method_exists($this->testClassInstance, $this->testMethod)) {
if (!method_exists($this->testClassInstance, $this->testMethod)) {
throw new \Exception("Method {$this->testMethod} can't be found in tested class");
}

Expand Down Expand Up @@ -192,4 +192,4 @@ public function getDependencies()
}
return $names;
}
}
}
2 changes: 1 addition & 1 deletion src/Codeception/Test/Descriptor.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,4 @@ public static function getTestFullName(\PHPUnit_Framework_SelfDescribing $testCa
}
return self::getTestFileName($testCase) . ':' . $testCase->toString();
}
}
}
2 changes: 1 addition & 1 deletion src/Codeception/Test/Feature/AssertionCounter.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ protected function assertionCounterEnd()
{
$this->numAssertions = \PHPUnit_Framework_Assert::getCount();
}
}
}
5 changes: 1 addition & 4 deletions src/Codeception/Test/Feature/CodeCoverage.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,5 @@ public function codeCoverageEnd($status, $time)
$this->getTestResultObject()->addError($this, $cce, $time);
}
}

}


}
}
2 changes: 1 addition & 1 deletion src/Codeception/Test/Feature/ErrorLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ public function errorLoggerEnd($status, $time, $exception = null)
$this->getTestResultObject()->addFailure($this, $exception, $time);
}
}
}
}
2 changes: 1 addition & 1 deletion src/Codeception/Test/Feature/IgnoreIfMetadataBlocked.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ protected function ignoreIfMetadataBlockedStart()
return;
}
}
}
}
3 changes: 1 addition & 2 deletions src/Codeception/Test/Feature/MetadataCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,4 @@ public function getFileName()
{
return $this->getMetadata()->getFilename();
}

}
}
2 changes: 1 addition & 1 deletion src/Codeception/Test/Feature/ScenarioLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ public function getScenarioText($format = 'text')
*/
abstract protected function getParser();
abstract public function getSourceCode();
}
}
1 change: 0 additions & 1 deletion src/Codeception/Test/Gherkin.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ public function __construct(FeatureNode $featureNode, ScenarioInterface $scenari
$this->getMetadata()->setName($featureNode->getTitle());
$this->getMetadata()->setFeature($scenarioNode->getTitle());
$this->getMetadata()->setFilename($featureNode->getFile());

}

public function preload()
Expand Down
2 changes: 1 addition & 1 deletion src/Codeception/Test/Interfaces/Dependent.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
interface Dependent
{
public function getDependencies();
}
}
Loading

0 comments on commit e45ca52

Please sign in to comment.