-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Expand file tree
/
Copy pathMeta.php
More file actions
52 lines (42 loc) · 1.23 KB
/
Meta.php
File metadata and controls
52 lines (42 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
declare(strict_types=1);
namespace Codeception\Step;
use Codeception\Lib\ModuleContainer;
use Codeception\Step as CodeceptionStep;
use function array_pop;
use function end;
use function is_string;
use function str_contains;
use function str_replace;
class Meta extends CodeceptionStep
{
public function run(?ModuleContainer $container = null): void
{
}
public function setTraceInfo(string $file, int $line): void
{
$this->file = $file;
$this->line = $line;
}
public function setPrefix(string $actor): void
{
$this->prefix = $actor;
}
public function getArgumentsAsString(int $maxLength = self::DEFAULT_MAX_LENGTH): string
{
$backup = $this->arguments;
$lastArg = end($this->arguments);
$lastArgStr = '';
if (is_string($lastArg) && str_contains($lastArg, "\n")) {
$lastArgStr = "\r\n " . str_replace("\n", "\n ", $lastArg);
array_pop($this->arguments);
}
$result = parent::getArgumentsAsString($maxLength) . $lastArgStr;
$this->arguments = $backup;
return $result;
}
public function setFailed(bool $failed): void
{
$this->failed = $failed;
}
}