| 
<?php
namespace webfan\InstallShield\apc;
 
 
 
 class Test
 {
 public function run(){
 echo 'test'.PHP_EOL;
 
 \frdl\webfan\App::God(false)->apc()
 ->on('test', 'hello', $this)
 
 ->trigger('test')
 ;
 
 
 
 
 /**
 *        $fo = new \O;
 $fo->cancel = $clear;
 $fo->add = $addState;
 $fo->events = $eventArray;
 $fo->status = $eventData;
 $fo->stateReady = $stateReady;
 $fo->stateGet = $stateGet;
 */
 
 $test_state = \frdl\webfan\App::God(false)->apc()
 ->
 required(array('ready', 'test-event-1', 'ontest', 'foo', 'bar'), array($this, 'fin1'), false)
 
 ;
 
 //    print_r($test_state);
 
 //    echo '$test_state->stateReady("foo") expects to be false and is: '.$test_state->stateReady("foo").PHP_EOL;
 echo 'trigger foo'.PHP_EOL;
 //        echo '$test_state->stateReady("foo") expects to be false and is: '.$test_state->stateReady("foo").PHP_EOL;
 \frdl\webfan\App::God(false)->apc()
 ->on('foo', 'hello', $this)
 
 ->trigger('foo', array(1,2,3))
 
 ->trigger('ready', array(1,2,3))
 ->trigger('test-event-1', array(1,2,3))
 ->trigger('ontest', array(1,2,3))
 ->trigger('foo', array(1,2,3))
 ->trigger('bar', array(1,2,3))
 ;
 /**
 * should print:
 * test hello world trigger foo hello world hello world fin1 final state 1 reached
 */
 
 //        echo '$test_state->stateReady("foo") expects to be false and is: '.$test_state->stateReady("foo").PHP_EOL;
 
 }
 
 
 public function hello(){
 echo 'hello world'.PHP_EOL;
 //     echo $_SERVER['DOCUMENT_ROOT'].PHP_EOL;
 }
 
 
 public function fin1(){
 echo 'fin1 final state 1 reached'.PHP_EOL;
 }
 
 
 }
 |