init
This commit is contained in:
8
vendor/codeception/base/src/Codeception/Step/Action.php
vendored
Normal file
8
vendor/codeception/base/src/Codeception/Step/Action.php
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
namespace Codeception\Step;
|
||||
|
||||
use Codeception\Step;
|
||||
|
||||
class Action extends Step
|
||||
{
|
||||
}
|
||||
23
vendor/codeception/base/src/Codeception/Step/Argument/FormattedOutput.php
vendored
Normal file
23
vendor/codeception/base/src/Codeception/Step/Argument/FormattedOutput.php
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Codeception\Step\Argument;
|
||||
|
||||
/**
|
||||
* Implemented in Step arguments where literal values need to be modified in test execution output (e.g. passwords).
|
||||
*/
|
||||
interface FormattedOutput
|
||||
{
|
||||
/**
|
||||
* Returns the argument's value formatted for output.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getOutput();
|
||||
|
||||
/**
|
||||
* Returns the argument's literal value.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString();
|
||||
}
|
||||
32
vendor/codeception/base/src/Codeception/Step/Argument/PasswordArgument.php
vendored
Normal file
32
vendor/codeception/base/src/Codeception/Step/Argument/PasswordArgument.php
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace Codeception\Step\Argument;
|
||||
|
||||
class PasswordArgument implements FormattedOutput
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $password;
|
||||
|
||||
public function __construct($password)
|
||||
{
|
||||
$this->password = $password;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getOutput()
|
||||
{
|
||||
return '******';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return $this->password;
|
||||
}
|
||||
}
|
||||
8
vendor/codeception/base/src/Codeception/Step/Assertion.php
vendored
Normal file
8
vendor/codeception/base/src/Codeception/Step/Assertion.php
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
namespace Codeception\Step;
|
||||
|
||||
use Codeception\Step as CodeceptionStep;
|
||||
|
||||
class Assertion extends CodeceptionStep
|
||||
{
|
||||
}
|
||||
38
vendor/codeception/base/src/Codeception/Step/Comment.php
vendored
Normal file
38
vendor/codeception/base/src/Codeception/Step/Comment.php
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
namespace Codeception\Step;
|
||||
|
||||
use Codeception\Lib\ModuleContainer;
|
||||
use Codeception\Step as CodeceptionStep;
|
||||
|
||||
class Comment extends CodeceptionStep
|
||||
{
|
||||
public function __toString()
|
||||
{
|
||||
return (string) $this->getAction();
|
||||
}
|
||||
|
||||
public function toString($maxLength)
|
||||
{
|
||||
return mb_strcut($this->__toString(), 0, $maxLength, 'utf-8');
|
||||
}
|
||||
|
||||
public function getHtml($highlightColor = '#732E81')
|
||||
{
|
||||
return '<strong>' . $this->getAction() . '</strong>';
|
||||
}
|
||||
|
||||
public function getPhpCode($maxLength)
|
||||
{
|
||||
return '// ' . $this->getAction();
|
||||
}
|
||||
|
||||
public function run(ModuleContainer $container = null)
|
||||
{
|
||||
// don't do anything, let's rest
|
||||
}
|
||||
|
||||
public function getPrefix()
|
||||
{
|
||||
return '';
|
||||
}
|
||||
}
|
||||
8
vendor/codeception/base/src/Codeception/Step/Condition.php
vendored
Normal file
8
vendor/codeception/base/src/Codeception/Step/Condition.php
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
namespace Codeception\Step;
|
||||
|
||||
use Codeception\Step as CodeceptionStep;
|
||||
|
||||
class Condition extends CodeceptionStep
|
||||
{
|
||||
}
|
||||
29
vendor/codeception/base/src/Codeception/Step/ConditionalAssertion.php
vendored
Normal file
29
vendor/codeception/base/src/Codeception/Step/ConditionalAssertion.php
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
namespace Codeception\Step;
|
||||
|
||||
use Codeception\Exception\ConditionalAssertionFailed;
|
||||
use Codeception\Lib\ModuleContainer;
|
||||
|
||||
class ConditionalAssertion extends Assertion
|
||||
{
|
||||
public function run(ModuleContainer $container = null)
|
||||
{
|
||||
try {
|
||||
parent::run($container);
|
||||
} catch (\PHPUnit\Framework\AssertionFailedError $e) {
|
||||
throw new ConditionalAssertionFailed($e->getMessage(), $e->getCode(), $e);
|
||||
}
|
||||
}
|
||||
|
||||
public function getAction()
|
||||
{
|
||||
$action = 'can' . ucfirst($this->action);
|
||||
$action = preg_replace('/^canDont/', 'cant', $action);
|
||||
return $action;
|
||||
}
|
||||
|
||||
public function getHumanizedAction()
|
||||
{
|
||||
return $this->humanize($this->action . ' ' . $this->getHumanizedArguments());
|
||||
}
|
||||
}
|
||||
25
vendor/codeception/base/src/Codeception/Step/Executor.php
vendored
Normal file
25
vendor/codeception/base/src/Codeception/Step/Executor.php
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
namespace Codeception\Step;
|
||||
|
||||
use Codeception\Step as CodeceptionStep;
|
||||
use Codeception\Lib\ModuleContainer;
|
||||
|
||||
class Executor extends CodeceptionStep
|
||||
{
|
||||
|
||||
protected $callable = null;
|
||||
|
||||
public function __construct(\Closure $callable, $arguments = [])
|
||||
{
|
||||
parent::__construct('execute callable function', []);
|
||||
|
||||
$this->callable = $callable;
|
||||
}
|
||||
|
||||
public function run(ModuleContainer $container = null)
|
||||
{
|
||||
$callable = $this->callable;
|
||||
|
||||
return $callable();
|
||||
}
|
||||
}
|
||||
18
vendor/codeception/base/src/Codeception/Step/Incomplete.php
vendored
Normal file
18
vendor/codeception/base/src/Codeception/Step/Incomplete.php
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
namespace Codeception\Step;
|
||||
|
||||
use Codeception\Step as CodeceptionStep;
|
||||
use Codeception\Lib\ModuleContainer;
|
||||
|
||||
class Incomplete extends CodeceptionStep
|
||||
{
|
||||
public function run(ModuleContainer $container = null)
|
||||
{
|
||||
throw new \PHPUnit\Framework\IncompleteTestError($this->getAction());
|
||||
}
|
||||
|
||||
public function __toString()
|
||||
{
|
||||
return $this->getAction();
|
||||
}
|
||||
}
|
||||
42
vendor/codeception/base/src/Codeception/Step/Meta.php
vendored
Normal file
42
vendor/codeception/base/src/Codeception/Step/Meta.php
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
namespace Codeception\Step;
|
||||
|
||||
use Codeception\Lib\ModuleContainer;
|
||||
use Codeception\Step as CodeceptionStep;
|
||||
|
||||
class Meta extends CodeceptionStep
|
||||
{
|
||||
public function run(ModuleContainer $container = null)
|
||||
{
|
||||
}
|
||||
|
||||
public function setTraceInfo($file, $line)
|
||||
{
|
||||
$this->file = $file;
|
||||
$this->line = $line;
|
||||
}
|
||||
|
||||
public function setPrefix($actor)
|
||||
{
|
||||
$this->prefix = $actor;
|
||||
}
|
||||
|
||||
public function getArgumentsAsString($maxLength = 200)
|
||||
{
|
||||
$argumentBackup = $this->arguments;
|
||||
$lastArgAsString = '';
|
||||
$lastArg = end($this->arguments);
|
||||
if (is_string($lastArg) && strpos($lastArg, "\n") !== false) {
|
||||
$lastArgAsString = "\r\n " . str_replace("\n", "\n ", $lastArg);
|
||||
array_pop($this->arguments);
|
||||
}
|
||||
$result = parent::getArgumentsAsString($maxLength) . $lastArgAsString;
|
||||
$this->arguments = $argumentBackup;
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function setFailed($failed)
|
||||
{
|
||||
$this->failed = $failed;
|
||||
}
|
||||
}
|
||||
3
vendor/codeception/base/src/Codeception/Step/README.md
vendored
Normal file
3
vendor/codeception/base/src/Codeception/Step/README.md
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
# Steps
|
||||
|
||||
Steps are used in scenarios. They do not keep any logic, but responsible for formatting. Exception for `ConditionalAssertion` which acts like `Assertion` but acts differently on fail.
|
||||
18
vendor/codeception/base/src/Codeception/Step/Skip.php
vendored
Normal file
18
vendor/codeception/base/src/Codeception/Step/Skip.php
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
namespace Codeception\Step;
|
||||
|
||||
use Codeception\Step as CodeceptionStep;
|
||||
use Codeception\Lib\ModuleContainer;
|
||||
|
||||
class Skip extends CodeceptionStep
|
||||
{
|
||||
public function run(ModuleContainer $container = null)
|
||||
{
|
||||
throw new \PHPUnit\Framework\SkippedTestError($this->getAction());
|
||||
}
|
||||
|
||||
public function __toString()
|
||||
{
|
||||
return $this->getAction();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user