Skip to content

Commit cda62cc

Browse files
committed
tests: add unit test for resource call class
1 parent 375be4c commit cda62cc

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

tests/Unit/Model/ResourceCallTest.php

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
3+
/*****************************************************************************
4+
*
5+
* PROJECT: MTA PHP SDK
6+
* LICENSE: See LICENSE in the top level directory
7+
* FILE: ResourceCallTest.php
8+
*
9+
* Multi Theft Auto is available from http://www.multitheftauto.com/
10+
*
11+
*****************************************************************************/
12+
13+
declare(strict_types=1);
14+
15+
namespace MultiTheftAuto\Sdk\Model;
16+
17+
use PHPUnit\Framework\TestCase;
18+
19+
class ResourceCallTest extends TestCase
20+
{
21+
public function testItMakeACallToResourceInstance()
22+
{
23+
$functionName = 'getSomething';
24+
$firstParameter = 'firstParameter';
25+
$secondParameter = 'secondParameter';
26+
27+
$resource = $this->prophesize(Resource::class);
28+
$resource
29+
->call($functionName, $firstParameter, $secondParameter)
30+
->shouldBeCalled();
31+
32+
$resourceCall = new ResourceCall($resource->reveal());
33+
$resourceCall->$functionName($firstParameter, $secondParameter);
34+
}
35+
}

0 commit comments

Comments
 (0)