| 123456789101112131415161718192021222324252627282930313233343536 |
- <?php
- use App\Service\Rest\Operation\CreateOperation;
- use App\Service\Rest\Operation\DeleteOperation;
- use PHPUnit\Framework\TestCase;
- class DeleteOperationTest extends TestCase
- {
- public function testGetters() {
- $operation = new DeleteOperation(
- 'Delete a dinosaur',
- 'dinosaur',
- 1
- );
- $this->assertEquals('DELETE', $operation->getMethod());
- $this->assertEquals('dinosaur', $operation->getEntityName());
- $this->assertEquals('dinosaur/1', $operation->getPath());
- $this->assertEquals('DELETE dinosaur/1', (string)$operation);
- }
- public function testGetChangeLog() {
- $operation = new DeleteOperation(
- 'Delete a dinosaur',
- 'dinosaur',
- 1
- );
- $this->assertEquals(
- ['[DELETE dinosaur/1]'],
- $operation->getChangeLog()
- );
- }
- }
|