Exemple #1
0
 public function testFun()
 {
     Mock::generate('MyClass', 'MyMock');
     $m = new MyMock();
     Ernie::mod('test', array('a' => array($m, 'a')));
     Ernie::fun('b', array($m, 'b'));
     $m->expectCallCount('a', 1);
     $m->expectCallCount('b', 1);
     Ernie::dispatch('test', 'a', array());
     Ernie::dispatch('test', 'b', array());
 }
Exemple #2
0
<?php

require_once 'classes/Bert.php';
require_once 'classes/Ernie.php';
Ernie::mod('calculator', array('add' => function ($a, $b) {
    return $a + $b;
}, 'subtract' => function ($a, $b) {
    return $a - $b;
}));
Ernie::start();