Last active
December 11, 2015 23:08
-
-
Save jubianchi/4674321 to your computer and use it in GitHub Desktop.
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 jubianchi { | |
class foo { | |
public function __construct($foo, $bar) { | |
echo $foo . '-' . $bar; | |
} | |
} | |
} | |
namespace tests\units\jubianchi { | |
use mageekguy\atoum; | |
require_once __DIR__ . '/../../vendor/autoload.php'; | |
require_once __DIR__ . '/../../vendor/atoum/atoum/scripts/runner.php'; | |
class foo extends atoum\test { | |
public function testFoo() { | |
$this | |
->mockGenerator | |
->orphanize('__construct') | |
->then | |
->object($object = new \mock\jubianchi\foo()) | |
; | |
} | |
} | |
} |
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 jubianchi { | |
class foo { | |
public function __construct($foo, $bar) { | |
echo $foo . '-' . $bar; | |
} | |
} | |
} | |
namespace tests\units\jubianchi { | |
use mageekguy\atoum; | |
require_once __DIR__ . '/../../vendor/autoload.php'; | |
require_once __DIR__ . '/../../vendor/atoum/atoum/scripts/runner.php'; | |
class foo extends atoum\test { | |
public function testFoo() { | |
$this | |
->mockGenerator | |
->overload(new atoum\mock\php\method('__construct')) | |
->and($controller = new atoum\mock\controller()) | |
->and($controller->__construct = function() {}) | |
->then | |
->object($object = new \mock\jubianchi\foo($controller)) | |
; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment