Skip to content

Commit a306bd4

Browse files
committed
D10 version
1 parent a9b39d9 commit a306bd4

7 files changed

Lines changed: 46 additions & 42 deletions

File tree

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
}
1010
],
1111
"require": {
12-
"codeception/codeception": "^4 || ^5",
13-
"codeception/module-webdriver": "^3 || ^4",
12+
"codeception/codeception": "^5",
13+
"codeception/module-webdriver": "^4",
1414
"webflo/drupal-finder": "^1.2",
1515
"fakerphp/faker": "^1.23",
1616
"codeception/module-phpbrowser": "*",

src/Codeception/Module/DrupalBootstrap.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
* #### Example (DrupalBootstrap)
1818
* modules:
1919
* - DrupalBootstrap:
20-
* root: './web'
21-
* site_path: 'sites/default'
22-
* http_host: 'mysite.local'
20+
* root: './web'
21+
* site_path: 'sites/default'
22+
* http_host: 'mysite.local'
2323
*
2424
* @package Codeception\Module
2525
*/
@@ -30,7 +30,7 @@ class DrupalBootstrap extends Module {
3030
*
3131
* @var array
3232
*/
33-
protected $config = [
33+
protected array $config = [
3434
'site_path' => 'sites/default',
3535
];
3636

src/Codeception/Module/DrupalDrush.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212
* #### Example (DrupalDrush)
1313
* modules:
1414
* - DrupalDrush:
15-
* working_directory: './web'
16-
* timeout: 120
17-
* drush: './vendor/bin/drush'
18-
* alias: '@mysite.com'
19-
* options:
20-
* uri: http://mydomain.com
21-
* root: /app/web
15+
* working_directory: './web'
16+
* timeout: 120
17+
* drush: './vendor/bin/drush'
18+
* alias: '@mysite.com'
19+
* options:
20+
* uri: http://mydomain.com
21+
* root: /app/web
2222
*
2323
* @package Codeception\Module
2424
*/
@@ -29,7 +29,7 @@ class DrupalDrush extends Module {
2929
*
3030
* @var array
3131
*/
32-
protected $config = [
32+
protected array $config = [
3333
'drush' => 'drush',
3434
'alias' => '',
3535
'options' => [],

src/Codeception/Module/DrupalEntity.php

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@
33
namespace Codeception\Module;
44

55
use Codeception\Module;
6+
use Codeception\TestInterface;
67
use Drupal\Core\Entity\FieldableEntityInterface;
78
use Drupal\Core\Url;
89
use Codeception\TestCase;
10+
use Exception;
911

1012
/**
1113
* Class DrupalEntity.
@@ -14,12 +16,12 @@
1416
* #### Example (DrupalEntity)
1517
* modules:
1618
* - DrupalEntity:
17-
* cleanup_test: true
18-
* cleanup_failed: false
19-
* cleanup_suite: true
20-
* route_entities:
21-
* - node
22-
* - taxonomy_term.
19+
* cleanup_test: true
20+
* cleanup_failed: false
21+
* cleanup_suite: true
22+
* route_entities:
23+
* - node
24+
* - taxonomy_term.
2325
*
2426
* @package Codeception\Module
2527
*/
@@ -30,7 +32,7 @@ class DrupalEntity extends Module {
3032
*
3133
* @var array
3234
*/
33-
protected $config = [
35+
protected array $config = [
3436
'cleanup_test' => TRUE,
3537
'cleanup_failed' => TRUE,
3638
'cleanup_suite' => TRUE,
@@ -60,7 +62,7 @@ public function _afterSuite() { // @codingStandardsIgnoreLine
6062
/**
6163
* {@inheritdoc}
6264
*/
63-
public function _after(TestCase $test) { // @codingStandardsIgnoreLine
65+
public function _after(TestInterface $test) { // @codingStandardsIgnoreLine
6466
if ($this->config['cleanup_test']) {
6567
$this->doEntityCleanup();
6668
}
@@ -69,7 +71,7 @@ public function _after(TestCase $test) { // @codingStandardsIgnoreLine
6971
/**
7072
* {@inheritdoc}
7173
*/
72-
public function _failed(TestCase $test, $fail) { // @codingStandardsIgnoreLine
74+
public function _failed(TestInterface $test, Exception $fail) { // @codingStandardsIgnoreLine
7375
if ($this->config['cleanup_failed']) {
7476
$this->doEntityCleanup();
7577
}

src/Codeception/Module/DrupalUser.php

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33
namespace Codeception\Module;
44

55
use Codeception\Module;
6+
use Codeception\TestInterface;
67
use Drupal\Core\Config\StorageInterface;
78
use Drupal\Core\Entity\EntityStorageInterface;
89
use Drupal\user\Entity\User;
910
use Faker\Factory;
1011
use Codeception\Util\Drush;
12+
use Exception;
1113

1214
/**
1315
* Class DrupalUser.
@@ -16,17 +18,17 @@
1618
* #### Example (DrupalUser)
1719
* modules:
1820
* - DrupalUser:
19-
* default_role: 'authenticated'
20-
* driver: 'PhpBrowser'
21-
* drush: './vendor/bin/drush'
22-
* cleanup_entities:
23-
* - media
24-
* - file
25-
* - paragraph
26-
* cleanup_test: false
27-
* cleanup_failed: false
28-
* cleanup_suite: true
29-
* alias: @site.com
21+
* default_role: 'authenticated'
22+
* driver: 'PhpBrowser'
23+
* drush: './vendor/bin/drush'
24+
* cleanup_entities:
25+
* - media
26+
* - file
27+
* - paragraph
28+
* cleanup_test: false
29+
* cleanup_failed: false
30+
* cleanup_suite: true
31+
* alias: @site.com
3032
*
3133
* @package Codeception\Module
3234
*/
@@ -51,7 +53,7 @@ class DrupalUser extends Module {
5153
*
5254
* @var array
5355
*/
54-
protected $config = [
56+
protected array $config = [
5557
'alias' => '',
5658
'default_role' => 'authenticated',
5759
'driver' => 'WebDriver',
@@ -65,7 +67,7 @@ class DrupalUser extends Module {
6567
/**
6668
* {@inheritdoc}
6769
*/
68-
public function _beforeSuite($settings = []) { // @codingStandardsIgnoreLine
70+
public function _beforeSuite(array $settings = []) { // @codingStandardsIgnoreLine
6971
$this->driver = null;
7072
if (!$this->hasModule($this->_getConfig('driver'))) {
7173
$this->fail('User driver module not found.');
@@ -77,7 +79,7 @@ public function _beforeSuite($settings = []) { // @codingStandardsIgnoreLine
7779
/**
7880
* {@inheritdoc}
7981
*/
80-
public function _after(\Codeception\TestCase $test) { // @codingStandardsIgnoreLine
82+
public function _after(TestInterface $test) { // @codingStandardsIgnoreLine
8183
if ($this->_getConfig('cleanup_test')) {
8284
$this->userCleanup();
8385
}
@@ -86,7 +88,7 @@ public function _after(\Codeception\TestCase $test) { // @codingStandardsIgnoreL
8688
/**
8789
* {@inheritdoc}
8890
*/
89-
public function _failed(\Codeception\TestCase $test, $fail) { // @codingStandardsIgnoreLine
91+
public function _failed(TestInterface $test, Exception $fail) { // @codingStandardsIgnoreLine
9092
if ($this->_getConfig('cleanup_failed')) {
9193
$this->userCleanup();
9294
}

src/Codeception/Module/DrupalWatchdog.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class DrupalWatchdog extends Module {
3535
*
3636
* @var array
3737
*/
38-
protected $config = [
38+
protected array $config = [
3939
'channels' => [],
4040
'level' => 'ERROR',
4141
'enabled' => TRUE,

src/Codeception/TestDrupalKernel.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44

55
use Drupal\Core\DrupalKernel;
66
use Drupal\Core\Site\Settings;
7-
use Symfony\Cmf\Component\Routing\RouteObjectInterface;
7+
use Drupal\Core\Routing\RouteObjectInterface;
88
use Symfony\Component\HttpFoundation\Request;
99
use Symfony\Component\Routing\Route;
1010

11-
class TestDrupalKernel extends DrupalKernel{
11+
class TestDrupalKernel extends DrupalKernel {
1212

1313
/**
1414
* TestDrupalKernel constructor.
@@ -44,4 +44,4 @@ public function bootTestEnvironment($sitePath, Request $request){
4444
$this->container->get('router.request_context')->fromRequest($request);
4545
}
4646

47-
}
47+
}

0 commit comments

Comments
 (0)