for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace RazonYang\Yii2\Setting\Tests\Unit;
use Codeception\Test\Unit;
use RazonYang\Yii2\Setting\DbManager;
use RazonYang\Yii2\Setting\Tests\Fixture\SettingFixture;
class DbManagerTest extends Unit
{
private function getDataFile(): string
return codecept_data_dir() . 'setting.php';
}
public function _fixtures()
return [
'setting' => [
'class' => SettingFixture::className(),
yii\base\BaseObject::className()
If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated annotation
ignore-deprecated
'class' => /** @scrutinizer ignore-deprecated */ SettingFixture::className(),
This function has been deprecated. The supplier of the function has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.
'dataFile' => $this->getDataFile()
]
];
public function testLoad(): void
$data = require $this->getDataFile();
$manager = new DbManager();
$settings = $manager->load();
$this->assertCount(count($data), $settings);
foreach ($data as $id => $fields) {
$this->assertArrayHasKey($id, $settings);
$this->assertSame($fields['value'], $settings[$id]);
This function has been deprecated. The supplier of the function has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.