0
Could someone make an example? Considering my class below:
class MinhaClasse
{
private $param;
public function __construct(array $params = []) {
$this->param = $params;
}
}
I have my test class:
require_once "MinhaClasse.php";
class MinhaClasseTest extends PHPUnit_Framework_TestCase
{
/**
* @dataProvider additionProvider
*/
public function additionProvider()
{
return array(
array('?????', null, null),
array(0, 1, 1),
array(1, 0, 1),
array(1, 1, 3)
);
}
public function testShouldMyClassIsInstantiate($instance, $value, $expected)
{
$this->assertEquals($expected, $value);
}
}
Thanks for the @Lollipop reply, but my question is not how to use dataProvider, what I need to know is how I could do a test that would answer me if the class tested by dataProvider was instantiated through PHP Unit, maybe put something like
instanceof
...– Ivan Ferrer