Created
May 23, 2015 11:07
-
-
Save Rayne/5afcf404d334465850db to your computer and use it in GitHub Desktop.
Basic FatFreeFramework/Base->mock() + PHPUnit example
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 | |
class F3PHPUnitTest extends PHPUnit_Framework_TestCase { | |
public function test() { | |
$f3 = Base::instance(); | |
// Don't write to STDOUT | |
$f3->set('QUIET', true); | |
$f3->route('GET /path', function(){ echo 'TEXT'; }); | |
$this->assertNull($f3->mock('GET /path')); | |
$this->assertSame('TEXT', $f3->get('RESPONSE')); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
I have a problem with mock and phpunit
when I use base->mock() Assertion did not work $this->expectOutputString.
look here https://stackoverflow.com/questions/61594665/how-to-use-expectoutputstring-phpunits/61594808#61594808
For the record, this is not the whole problem, I hope it's not problem.