for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
require_once 'BaseTester.php';
/** @group Item */
class ItemTest extends BaseTester
{
/** @test */
public function it_gets_items_for_an_by_user_id()
$items = $this->steamClient->item()->GetPlayerItems($this->itemid, $this->id64);
item()
$appId
This check looks for function calls that miss required arguments.
$this->assertCount(1, $items);
$items
null|array
object<Countable>|object...nit\Framework\iterable>
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example:
function acceptsInteger($int) { } $x = '123'; // string "123" // Instead of acceptsInteger($x); // we recommend to use acceptsInteger((integer) $x);
$item = $items->first();
first
Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.
$this->checkItemProperties($item);
checkItemProperties()
BaseTester
This check looks for access to methods that are not accessible from the current context.
If you need to make a method accessible to another context you can raise its visibility level in the defining class.
}