for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Adelarcubs\OFXParser\Unit;
use PHPUnit_Framework_TestCase;
use SimpleXMLElement;
use Adelarcubs\OFXParser\Ofx;
/**
*
* @author Adelar Tiemann Junior <[email protected]>
*/
class OfxTest extends PHPUnit_Framework_TestCase
{
private $ofx;
protected function setUp()
$this->ofx = Ofx::loadFromFile(__DIR__ . '/../fixtures/data.ofx');
__DIR__ . '/../fixtures/data.ofx'
string
object<Adelarcubs\OFXParser\unknown>
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);
}
* @test
public function constructorShouldConfigureAttributes()
$this->assertInstanceOf(Ofx::class, $this->ofx);
* @expectedException InvalidArgumentException
public function invalidFile()
Ofx::loadFromFile('Anywhere');
'Anywhere'
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: