allow vendord
All checks were successful
Build, Push and Deploy / build-and-push (push) Successful in 3m3s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 16s
Build, Push and Deploy / deploy-staging (push) Successful in 32s
Build, Push and Deploy / deploy-production (push) Has been skipped
Build, Push and Deploy / cleanup (push) Successful in 1s
All checks were successful
Build, Push and Deploy / build-and-push (push) Successful in 3m3s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 16s
Build, Push and Deploy / deploy-staging (push) Successful in 32s
Build, Push and Deploy / deploy-production (push) Has been skipped
Build, Push and Deploy / cleanup (push) Successful in 1s
This commit is contained in:
61
vendor/fedapay/fedapay-php/tests/ResourceTest.php
vendored
Normal file
61
vendor/fedapay/fedapay-php/tests/ResourceTest.php
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
namespace Tests;
|
||||
|
||||
class ResourceTest extends BaseTestCase
|
||||
{
|
||||
/**
|
||||
* Should return the right class name
|
||||
* @return void
|
||||
*/
|
||||
public function testReturnClassName()
|
||||
{
|
||||
$this->assertEquals(Fixtures\Foo::className(), 'foo');
|
||||
$this->assertEquals(Fixtures\FooTest::className(), 'footest');
|
||||
}
|
||||
|
||||
/**
|
||||
* Should return the right class url
|
||||
* @return void
|
||||
*/
|
||||
public function testShouldReturnClassUrl()
|
||||
{
|
||||
$this->assertEquals(Fixtures\Foo::classPath(), '/foos');
|
||||
$this->assertEquals(Fixtures\FooTest::classPath(), '/footests');
|
||||
$this->assertEquals(Fixtures\FooPerson::classPath(), '/foopeople');
|
||||
$this->assertEquals(Fixtures\FooCurrency::classPath(), '/foocurrencies');
|
||||
}
|
||||
|
||||
/**
|
||||
* Should return throw InvalidRequest exception if id is null
|
||||
* @return void
|
||||
*/
|
||||
public function testShouldThrowInvalidRequest()
|
||||
{
|
||||
$this->expectException(\FedaPay\Error\InvalidRequest::class);
|
||||
$this->expectExceptionMessage(
|
||||
'Could not determine which URL to request: Tests\Fixtures\Foo instance has invalid ID: '
|
||||
);
|
||||
Fixtures\Foo::resourcePath(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Should return return resource url
|
||||
* @return void
|
||||
*/
|
||||
public function testReturnResourceUrl()
|
||||
{
|
||||
$this->assertEquals(Fixtures\Foo::resourcePath(1), '/foos/1');
|
||||
}
|
||||
|
||||
/**
|
||||
* Should return return resource url
|
||||
* @return void
|
||||
*/
|
||||
public function testReturnInstanceUrl()
|
||||
{
|
||||
$object = new Fixtures\Foo;
|
||||
$object->id = 1;
|
||||
$this->assertEquals($object->instanceUrl(), '/foos/1');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user