Created
February 26, 2013 09:01
-
-
Save jdeniau/5037116 to your computer and use it in GitHub Desktop.
atoum setUp + mock
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Plop\Tests\Units\Doctrine; | |
use \atoum; | |
class Plip extends atoum | |
{ | |
/** | |
* setUp | |
* | |
* @access public | |
* @return void | |
*/ | |
public function setUp() | |
{ | |
$class = new \mock\Doctrine\Common\Persistence\Mapping\ClassMetada; | |
$this->dump($class); | |
} | |
// just to trigger the test ;) | |
public function testVersionNumber() { | |
$this->string('a')->isEqualTo('a'); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Fatal error: Class 'mock\Doctrine\Common\Persistence\Mapping\ClassMetada' not found in Plop/Tests/Units/Doctrine/Plip.php on line 19 | |
Call Stack: | |
0.0147 1691016 1. mageekguy\atoum\scripts\runner::mageekguy\atoum\scripts\{closure}() phar:///usr/share/atoum/mageekguy.atoum.phar/1/classes/scripts/runner.php:0 | |
0.0147 1691176 2. mageekguy\atoum\scripts\runner->run() phar:///usr/share/atoum/mageekguy.atoum.phar/1/classes/scripts/runner.php:363 | |
0.0336 4069536 3. mageekguy\atoum\runner->run() phar:///usr/share/atoum/mageekguy.atoum.phar/1/classes/scripts/runner.php:190 | |
0.0582 4574720 4. mageekguy\atoum\test->run() phar:///usr/share/atoum/mageekguy.atoum.phar/1/classes/runner.php:487 | |
0.0584 4577832 5. mageekguy\atoum\test->runEngines() phar:///usr/share/atoum/mageekguy.atoum.phar/1/classes/test.php:979 | |
0.0585 4578352 6. Mapado\VersionControlBundle\Tests\Units\Doctrine\VersionManager->setUp() phar:///usr/share/atoum/mageekguy.atoum.phar/1/classes/test.php:1248 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Plop\Tests\Units\Doctrine; | |
use \atoum; | |
class Plip extends atoum | |
{ | |
/** | |
* setUp | |
* | |
* @access public | |
* @return void | |
*/ | |
public function setUp() | |
{ | |
$this->mockGenerator->generate('\Doctrine\Common\Persistence\Mapping\ClassMetada'); | |
$class = new \mock\Doctrine\Common\Persistence\Mapping\ClassMetada; | |
$this->dump($class); | |
} | |
// just to trigger the test ;) | |
public function testVersionNumber() { | |
$this->string('a')->isEqualTo('a'); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class mock\Doctrine\Common\Persistence\Mapping\ClassMetada#202 (1) { | |
private $mockController => | |
class mageekguy\atoum\mock\controller#175 (5) { | |
protected $mock => | |
... | |
protected $iterator => | |
class mageekguy\atoum\mock\controller\iterator#408 (3) { | |
protected $controller => | |
... | |
protected $methods => | |
array(0) { | |
... | |
} | |
protected $filters => | |
array(0) { | |
... | |
} | |
} | |
private $disableMethodChecking => | |
bool(true) | |
protected $calls => | |
array(0) { | |
} | |
protected $invokers => | |
array(1) { | |
'__call' => | |
NULL | |
} | |
} | |
} |
Bonjour monsieur Deniau.
Vous venez de me sauver ma vie car j'avais le même problème.
Vous êtes bien brave.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Il faut ajouter l'appel à
$this->mockGenerator->generate('\Doctrine\Common\Persistence\Mapping\ClassMetada');
danssetUp()
pour ne pas avoir d'erreur.