install:
- composer self-update --2
- composer update --ignore-platform-req=php
+ - composer remove phpunit/phpunit
+ - composer require --dev --ignore-platform-req=php phpunit/php-text-template ^2.0
+ - composer require --dev --ignore-platform-req=php phpunit/phpunit ^9.0
- language: php
php: 7.4
- language: php
// JSON_PRETTY_PRINT is available from PHP 5.4.
$print = defined('JSON_PRETTY_PRINT') ? JSON_PRETTY_PRINT : 0;
$data = self::getPhpHeaders() . json_encode($conf, $print) . self::getPhpSuffix();
- if (!file_put_contents($filepath, $data)) {
+ if (empty($filepath) || !file_put_contents($filepath, $data)) {
throw new \Shaarli\Exceptions\IOException(
$filepath,
t('Shaarli could not create the config file. '.
$data = [];
$this->pluginManager->executeHooks('error', $data);
- $this->assertSame(
- 'test [plugin incompatibility]: Class \'Unknown\' not found',
+ $this->assertMatchesRegularExpression(
+ '/test \[plugin incompatibility\]: Class [\'"]Unknown[\'"] not found/',
$this->pluginManager->getErrors()[0]
);
}
public function testReadInvalidJson()
{
$this->expectException(\Exception::class);
- $this->expectExceptionMessageRegExp(' /An error occurred while parsing JSON configuration file \\([\\w\\/\\.]+\\): error code #4/');
+ $this->expectExceptionMessageRegExp('/An error occurred while parsing JSON configuration file \\([\\w\\/\\.]+\\): error code #4/');
$this->configIO->read('tests/utils/config/configInvalid.json.php');
}
unlink($dest);
}
- /**
- * Write to invalid path.
- */
- public function testWriteInvalidArray()
- {
- $this->expectException(\Shaarli\Exceptions\IOException::class);
-
- $conf = array('conf' => 'value');
- @$this->configIO->write(array(), $conf);
- }
-
/**
* Write to invalid path.
*/
*
* @return bool true.
*/
- final private function updateMethodDummy1()
+ final protected function updateMethodDummy1()
{
return true;
}
*
* @return bool true.
*/
- final private function updateMethodDummy2()
+ final protected function updateMethodDummy2()
{
return true;
}
*
* @return bool true.
*/
- final private function updateMethodDummy3()
+ final protected function updateMethodDummy3()
{
return true;
}
*
* @throws Exception error.
*/
- final private function updateMethodException()
+ final protected function updateMethodException()
{
throw new Exception('whatever');
}