* @license http://www.apache.org/licenses/LICENSE-2.0 * @link http://phpsx.org */ class ResourceTest extends TestCase { public function testResource() { $resource = new Resource(Resource::STATUS_ACTIVE, '/foo'); $resource->setTitle('foobar'); $resource->setDescription('foobar'); $resource->setPathParameters('Path'); $resource->addMethod(Resource\Factory::getMethod('GET')); $this->assertEquals(Resource::STATUS_ACTIVE, $resource->getStatus()); $this->assertTrue($resource->isActive()); $this->assertFalse($resource->isDeprecated()); $this->assertFalse($resource->isClosed()); $this->assertEquals('/foo', $resource->getPath()); $this->assertEquals('foobar', $resource->getTitle()); $this->assertEquals('foobar', $resource->getDescription()); $this->assertEquals('Path', $resource->getPathParameters()); $this->assertInstanceOf(Resource\MethodAbstract::class, $resource->getMethod('GET')); $this->assertEquals(['GET' => $resource->getMethod('GET')], $resource->getMethods()); $this->assertEquals(['GET'], $resource->getAllowedMethods()); $this->assertTrue($resource->hasMethod('GET')); $this->assertFalse($resource->hasMethod('POST')); $this->assertTrue($resource->hasPathParameters()); } public function testGetMethodInvalid() { $this->expectException(\RuntimeException::class); $resource = new Resource(Resource::STATUS_ACTIVE, '/foo'); $resource->getMethod('GET'); } } __halt_compiler();----SIGNATURE:----i6TLfqAAaoSLYYd3/BTBu6VKrYgOQ6/J1u1FZNotTmc08Fp3ED6goaEbTvDLMWYH2jukYNuTckHYlU41Ko2MttcTfcfiq8Fq4t6LJVdFbQ4MonSdzooaJgDzjFQdA0j5KHKUMyv8IfFfFLaZy6RpSMonn0dakHqaheMNToC+HPIIpdLEp+tJjeQjuCseCS3xN/0BO62zdojMOp5SBfO6uPFUAO6GmiGWYyOFD50mNAvNry9tYoIRg6t5fEdl23+s+evrt3BZYeoXc5Ns5OdfsEcNCE/TRklJN0hEstxr/5dPtLLtPB6INzizqLq8ATttHj5RkHZCm8exDZDTbl6eHDwMNQDxx6rmp8ELuDYfwNV5YdB8StZYnESq/AGqJOU4MGdhokGwFErJIIAr+aujrx5yFz3AdZHM0QCLUctNiVsrE3eRBzU3RgpFRpsG/2gQ2a+NRZ4stSiyKQwt/iz8CNLJ2FH4YryzFGGYItjyqrn8453bGPhhO1+/YP1xZ//t9Tr9VCsIwjrCTsu9dUa30BrXuf6wFT2zW783b8iRTSHWnuGCrJQC96ksgvIAn+kB7jrOvy1Jz7YFW6iaC4ow1uUHxFquykewqjBwL7VpCcuo9rfwdQGqGZp/x1NiU5r8CG3ftca3E/Zc7xwvvibNInJO+W3tmot4LAxjbSakexU=----ATTACHMENT:----MTc2NTA0NzI3ODgyNDMxMiA0MTY2Njc4ODI1MTc3NTAgODk2MDg4MjM5MjY5MzE3NA==