Skip to content

Commit b41bf1b

Browse files
authored
Merge pull request #128 from DonCallisto/patch-4
Added php7.4
2 parents 76f4e40 + f4613bf commit b41bf1b

5 files changed

Lines changed: 16 additions & 24 deletions

File tree

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ language: php
22

33
matrix:
44
include:
5-
- php: 7.1
6-
env: deps=low
75
- php: 7.2
6+
env: deps=low
87
- php: 7.3
8+
- php: 7.4
99
fast_finish: true
1010

1111
before_script:

composer.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@
2020
}
2121
],
2222
"require": {
23-
"php": ">=7.1.3,<7.4",
23+
"php": "^7.2",
2424
"behat/behat": "^3.3",
2525
"behat/mink": "^1.7",
2626
"behat/mink-extension": "^2.2",
2727
"ocramius/proxy-manager": "^2.1.1"
2828
},
2929
"require-dev": {
3030
"behat/mink-goutte-driver": "^1.2",
31-
"bossa/phpspec2-expect": "^3.1",
31+
"bossa/phpspec2-expect": "^3.1.1",
3232
"fabpot/goutte": "^3.2",
33-
"phpspec/phpspec": "^5.1",
33+
"phpspec/phpspec": "^6.1",
3434
"symfony/filesystem": "^4.2 || ^5.0",
3535
"symfony/process": "^4.2 || ^5.0",
3636
"symfony/yaml": "^4.2 || ^5.0"
@@ -50,5 +50,8 @@
5050
"psr-4": {
5151
"SensioLabs\\Behat\\PageObjectExtension\\": "src/"
5252
}
53+
},
54+
"conflict": {
55+
"guzzlehttp/guzzle": "<6.3"
5356
}
5457
}

features/bootstrap/BehatRunnerContext.php

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@ class BehatRunnerContext implements Context
1414
*/
1515
private $workingDir;
1616

17-
/**
18-
* @var string|null
19-
*/
20-
private $phpBin;
21-
2217
/**
2318
* @var Process|null
2419
*/
@@ -32,8 +27,12 @@ public function bootstrap()
3227
$this->workingDir = sprintf('%s/%s/', sys_get_temp_dir(), uniqid('BehatPageObjectExtension_'));
3328
$this->getFilesystem()->mkdir($this->workingDir, 0777);
3429

35-
$this->phpBin = $this->findPhpBinary();
36-
$this->process = new Process(null);
30+
$this->process = new Process([
31+
$this->findPhpBinary(),
32+
BEHAT_BIN_PATH,
33+
'--format-settings={"timer": false}',
34+
'--format=progress'
35+
], $this->workingDir);
3736
}
3837

3938
/**
@@ -85,16 +84,6 @@ public function aContextFileNamedWith($fileName, PyStringNode $content)
8584
*/
8685
public function iRunBehat()
8786
{
88-
$this->process->setWorkingDirectory($this->workingDir);
89-
$this->process->setCommandLine(
90-
sprintf(
91-
'%s %s %s %s',
92-
$this->phpBin,
93-
escapeshellarg(BEHAT_BIN_PATH),
94-
strtr('--format-settings=\'{"timer": false}\'', array('\'' => '"', '"' => '\"')),
95-
'--format=progress'
96-
)
97-
);
9887
$this->process->start();
9988
$this->process->wait();
10089
}

features/bootstrap/PhpServerContext.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class PhpServerContext implements Context
1515
*/
1616
public static function startPhpServer()
1717
{
18-
self::$phpServer = new Process('php -S localhost:8000 features/application/index.php');
18+
self::$phpServer = new Process(['php', '-S', 'localhost:8000', 'features/application/index.php']);
1919
self::$phpServer->start();
2020

2121
sleep(1);

src/PageObject/Factory/CamelcasedClassNameResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ private function resolve($pageObjectName, array $namespaces, $pageObjectType)
6767
}
6868

6969
$message = sprintf('Could not find a class for the "%s" %s. ', $pageObjectName, $pageObjectType);
70-
$message.= sprintf('None of the configured namespaces worked: "%s"', implode($classNameCandidates, ', '));
70+
$message.= sprintf('None of the configured namespaces worked: "%s"', implode(', ', $classNameCandidates));
7171

7272
throw new \InvalidArgumentException($message);
7373
}

0 commit comments

Comments
 (0)