phpunit compatibility

This commit is contained in:
El RIDO 2021-10-07 22:34:15 +02:00
parent 168ce1d85c
commit 9c81d85bb7
No known key found for this signature in database
GPG Key ID: 0F5C940A6BD81F92
2 changed files with 5 additions and 13 deletions

View File

@ -43,7 +43,7 @@ class DatabaseTest extends TestCase
$this->assertNotEquals($salt, ''); $this->assertNotEquals($salt, '');
ServerSalt::setStore($this->_model); ServerSalt::setStore($this->_model);
ServerSalt::get(); ServerSalt::get();
$this->assertFileNotExists($file, 'legacy ServerSalt got removed'); $this->assertFileDoesNotExist($file, 'legacy ServerSalt got removed');
$this->assertEquals($salt, ServerSalt::get(), 'ServerSalt got preserved & migrated'); $this->assertEquals($salt, ServerSalt::get(), 'ServerSalt got preserved & migrated');
} }

View File

@ -184,10 +184,6 @@ class ModelTest extends TestCase
$paste->store(); $paste->store();
} }
/**
* @expectedException Exception
* @expectedExceptionCode 76
*/
public function testStoreFail() public function testStoreFail()
{ {
$path = $this->_path . DIRECTORY_SEPARATOR . 'model-store-test.sq3'; $path = $this->_path . DIRECTORY_SEPARATOR . 'model-store-test.sq3';
@ -224,13 +220,11 @@ class ModelTest extends TestCase
$paste = $model->getPaste(); $paste = $model->getPaste();
$paste->setData($pasteData); $paste->setData($pasteData);
$this->expectException(Exception::class);
$this->expectExceptionCode(76);
$paste->store(); $paste->store();
} }
/**
* @expectedException Exception
* @expectedExceptionCode 70
*/
public function testCommentStoreFail() public function testCommentStoreFail()
{ {
$path = $this->_path . DIRECTORY_SEPARATOR . 'model-test.sq3'; $path = $this->_path . DIRECTORY_SEPARATOR . 'model-test.sq3';
@ -272,13 +266,11 @@ class ModelTest extends TestCase
$comment = $paste->getComment(Helper::getPasteId()); $comment = $paste->getComment(Helper::getPasteId());
$comment->setData($commentData); $comment->setData($commentData);
$this->expectException(Exception::class);
$this->expectExceptionCode(70);
$comment->store(); $comment->store();
} }
/**
* @expectedException Exception
* @expectedExceptionCode 69
*/
public function testCommentDuplicate() public function testCommentDuplicate()
{ {
$pasteData = Helper::getPastePost(); $pasteData = Helper::getPastePost();