liip / liip/LiipDrupalRegistryModule
MySQL `register()` tests fail under PHP 5.4
- Dominant language
- PHP
- Stars
- 3
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Description
I get some errors running the MySQL tests with PHP 5.4. In the test `register()` is called with an array (but it expects a string) and the `NoOpDecorator` is used which doesn't do a conversion. So when building the MySQL insert it crashes. See following log:
```
There were 2 errors:
1) Liip\Drupal\Modules\Registry\Database\MySqlTest::testRegister
Array to string conversion
/Volumes/Work/workspace/LiipDrupalRegistryModule/src/Liip/Drupal/Modules/Registry/Database/MySql.php:53
/Volumes/Work/workspace/LiipDrupalRegistryModule/Tests/Liip/Drupal/Modules/Registry/Database/MySqlTest.php:292
2) Liip\Drupal\Modules\Registry\Database\MySqlTest::testReplace
Array to string conversion
/Volumes/Work/workspace/LiipDrupalRegistryModule/src/Liip/Drupal/Modules/Registry/Database/MySql.php:174
/Volumes/Work/workspace/LiipDrupalRegistryModule/Tests/Liip/Drupal/Modules/Registry/Database/MySqlTest.php:380
--
There was 1 failure:
1) Liip\Drupal\Modules\Registry\Database\MySqlTest::testRegisterExpectingException
Failed asserting that exception of type "PHPUnit_Framework_Error_Notice" matches expected exception "\Liip\Drupal\Modules\Registry\RegistryException". Message was: "Array to string conversion".
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with src/Liip/Drupal/Modules/Registry/Database/MySql.php at lines 53 and 174, then inspect MySqlTest.php around lines 292 and 380. Run the MySQL tests under PHP 5.4 and compare the register() and replace() inputs with the NoOpDecorator behavior. Done means the array conversion errors are resolved and testRegisterExpectingException receives the expected RegistryException.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- mysql, php
- Domain
- database
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100