diff options
| author | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2024-05-15 06:56:03 +0000 |
|---|---|---|
| committer | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2024-05-15 06:56:03 +0000 |
| commit | 24778635d3cea1bf2a1e59fccb4cccbdcf0af890 (patch) | |
| tree | 0adcb2503071942cb0d78b395b4bb27a1d48b9a7 /tests/_support | |
| parent | 4c0242f044a53979a08e7bec5913dc6a48b976f9 (diff) | |
update codeception/codeception to 5.1.2 and codeception/module-asserts to 3.0.0, fix test, fixes #4150
Closes #4150
Merge request studip/studip!2990
Diffstat (limited to 'tests/_support')
| -rw-r--r-- | tests/_support/Helper/Jsonapi.php | 2 | ||||
| -rw-r--r-- | tests/_support/Helper/StudipDb.php | 11 |
2 files changed, 6 insertions, 7 deletions
diff --git a/tests/_support/Helper/Jsonapi.php b/tests/_support/Helper/Jsonapi.php index 8d98e6a..2dec2d1 100644 --- a/tests/_support/Helper/Jsonapi.php +++ b/tests/_support/Helper/Jsonapi.php @@ -148,7 +148,7 @@ class Jsonapi extends \Codeception\Module return $handler->handle($request); }) - ->add(new Authentication($authenticator)); + ->add(new Authentication($authenticator, ['session'])); } return $app; diff --git a/tests/_support/Helper/StudipDb.php b/tests/_support/Helper/StudipDb.php index 90ad24c..c80338c 100644 --- a/tests/_support/Helper/StudipDb.php +++ b/tests/_support/Helper/StudipDb.php @@ -5,7 +5,7 @@ namespace Helper; use Codeception\Exception\ModuleConfigException; use Codeception\Exception\ModuleException; -require_once('lib/classes/StudipPDO.class.php'); +require_once 'lib/classes/StudipPDO.class.php'; class StudipDb extends \Codeception\Module { @@ -14,18 +14,17 @@ class StudipDb extends \Codeception\Module * * @var */ - public $dbh; + public ?\StudipPdo $dbh; /** * @var array */ - protected $config = [ - ]; + protected array $config = []; /** * @var array */ - protected $requiredFields = ['dsn', 'user', 'password']; + protected array $requiredFields = ['dsn', 'user', 'password']; /** * @SuppressWarnings(PHPMD.CamelCaseMethodName) @@ -42,7 +41,7 @@ class StudipDb extends \Codeception\Module private function checkConfig($configKey, $name) { - if (strstr($this->config[$configKey], '%'.$name.'%')) { + if (str_contains($this->config[$configKey], '%' . $name . '%')) { throw new ModuleConfigException(__CLASS__, 'You have to provide a '.$name.' either as ENV variable or in config_local.inc.php!'); } } |
