Ok the problem started happening again:
Code: Select all
function testSyncVoteCount()
{
$change = new Change;
$vote = $this->getVote( true );
$change->vote( $vote );
$ballot->setVoteCount( 10000 ); // here is where the error is, $ballot is a non object
$ballot->synchVoteCount();
$this->assertSame( 1, $ballot->getVoteCount(), 'After placing V, then setting vote count manually out of bounds, synch method will reset the vote count to 1' );
}
The error I get Is:
Code: Select all
Vote_BalletTest
....PHP Fatal error: Call to a member function setVoteCount() on a non-object in E:\dev\vafconform\application\Code\Vote\BallotTest.php on line 0
Fatal error: Call to a member function setVoteCount() on a non-object in E:\dev\vafconform\application\Code\Vote\BallotTest.php on line 0
I feel like I'm programming on the stone ages because I have to find execution errors by hand.
And check this out
..PHP Fatal error: Call to undefined method Vote::getChange() in E:\dev\vafconform\application\Code\Vote\MapperTest.php on line 29
PHP Stack trace:
PHP 1. {main}() C:\wamp\bin\php\php5.3.0\phpunit.php:0
PHP 2. PHPUnit_TextUI_Command::main() C:\wamp\bin\php\php5.3.0\phpunit.php:52
PHP 3. PHPUnit_TextUI_Command->run() C:\wamp\bin\php\php5.3.0\PHPUnit\TextUI\Command.php:147
PHP 4. PHPUnit_TextUI_TestRunner->doRun() C:\wamp\bin\php\php5.3.0\PHPUnit\TextUI\Command.php:214
PHP 5. PHPUnit_Framework_TestSuite->run() C:\wamp\bin\php\php5.3.0\PHPUnit\TextUI\TestRunner.php:350
PHP 6. PHPUnit_Framework_TestSuite->run() C:\wamp\bin\php\php5.3.0\PHPUnit\Framework\TestSuite.php:675
PHP 7. PHPUnit_Framework_TestSuite->runTest() C:\wamp\bin\php\php5.3.0\PHPUnit\Framework\TestSuite.php:732
PHP 8. PHPUnit_Framework_TestCase->run() C:\wamp\bin\php\php5.3.0\PHPUnit\Framework\TestSuite.php:756
PHP 9. PHPUnit_Framework_TestResult->run() C:\wamp\bin\php\php5.3.0\PHPUnit\Framework\TestCase.php:653
PHP 10. PHPUnit_Framework_TestCase->runBare() C:\wamp\bin\php\php5.3.0\PHPUnit\Framework\TestResult.php:687
PHP 11. PHPUnit_Framework_TestCase->runTest() C:\wamp\bin\php\php5.3.0\PHPUnit\Framework\TestCase.php:706
PHP 12. ReflectionMethod->invokeArgs() C:\wamp\bin\php\php5.3.0\PHPUnit\Framework\TestCase.php:822
PHP 13. Vote_MapperTest->testChange() E:\dev\vafconform\application\Code\Vote\MapperTest.php
:0
I guess its due to PHPUnit's use of reflection?