예제 #1
0
 public function testGetDiagnosticTests()
 {
     $c = new Clips(API_KEY);
     $d = $c->getDiagnosticTests();
     $this->assertInternalType('array', $d);
     $this->assertArrayHasKey('title', current($d));
     $this->assertArrayHasKey('name', current($d));
     $this->assertArrayHasKey('language', current($d));
 }
예제 #2
0
 public function __construct($name = CLIPS_MAIN_ENV)
 {
     if (!isset(Clips::$context)) {
         // Initialize the context
         Clips::$context = array();
         clips_init(Clips::$context);
         // Create the core env
         $this->createEnv(CLIPS_CORE_ENV);
         // Loading the core rules into core
         $this->switchCore();
         $path = dirname(__FILE__) . '/rules/clips.rules';
         // Load the default functions
         $this->load($path);
         $this->load(dirname(__FILE__) . '/rules/core.rules');
         // Come back to main again
         $this->switchMain();
     }
     if (!$this->isEnvExists($name)) {
         $this->createEnv($name);
         $this->_init_base_support();
     } else {
         // If the env is already exists
         $this->switchEnv($name);
     }
     // Switch the env to the name
 }