X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2Fapi%2Fcontrollers%2Ftags%2FPutTagTest.php;h=74edde787b745dbddeda6308e51d94c8bd8df61f;hb=a5a9cf23acd1248585173aa32757d9720b5f2d62;hp=e0bc8663ec399ae66bdabdd1ed5a389b48a029c9;hpb=8f60e1206e45e67c96a7630d4ff94e72fe875f09;p=github%2Fshaarli%2FShaarli.git diff --git a/tests/api/controllers/tags/PutTagTest.php b/tests/api/controllers/tags/PutTagTest.php index e0bc8663..74edde78 100644 --- a/tests/api/controllers/tags/PutTagTest.php +++ b/tests/api/controllers/tags/PutTagTest.php @@ -12,7 +12,7 @@ use Slim\Http\Environment; use Slim\Http\Request; use Slim\Http\Response; -class PutTagTest extends \PHPUnit\Framework\TestCase +class PutTagTest extends \Shaarli\TestCase { /** * @var string datastore to test write operations @@ -159,12 +159,12 @@ class PutTagTest extends \PHPUnit\Framework\TestCase /** * Test tag update with an empty new tag name => ApiBadParametersException - * - * @expectedException Shaarli\Api\Exceptions\ApiBadParametersException - * @expectedExceptionMessage New tag name is required in the request body */ public function testPutTagEmpty() { + $this->expectException(\Shaarli\Api\Exceptions\ApiBadParametersException::class); + $this->expectExceptionMessage('New tag name is required in the request body'); + $tagName = 'gnu'; $newName = ''; @@ -194,12 +194,12 @@ class PutTagTest extends \PHPUnit\Framework\TestCase /** * Test tag update on non existent tag => ApiTagNotFoundException. - * - * @expectedException Shaarli\Api\Exceptions\ApiTagNotFoundException - * @expectedExceptionMessage Tag not found */ public function testPutTag404() { + $this->expectException(\Shaarli\Api\Exceptions\ApiTagNotFoundException::class); + $this->expectExceptionMessage('Tag not found'); + $env = Environment::mock([ 'REQUEST_METHOD' => 'PUT', ]);