/** * @expectedException \yii\base\InvalidValueException * @expectedExceptionCode 2 */ function test_save_DirectoryIsNotWritable() { unlink($this->getConfigFilename()); chmod(dirname($this->getConfigFilename()), 0444); $this->config->save(); }