コード例 #1
0
ファイル: ModuleToolTest.php プロジェクト: danzabar/alice
 /**
  * Test the to array function
  *
  * @return void
  * @author Dan Cox
  */
 public function test_toArray()
 {
     $tool = new ModuleTool();
     $tool->addCommand('NewCommand');
     $settings = $tool->toArray();
     $this->assertEquals(array('commands' => array('NewCommand'), 'entity' => array()), $settings);
 }
コード例 #2
0
ファイル: ModuleCacheTest.php プロジェクト: danzabar/alice
 /**
  * Read and write
  *
  * @return void
  * @author Dan Cox
  */
 public function test_readFromAndWrite()
 {
     $this->config->shouldReceive('load')->andReturn($this->config);
     $this->config->shouldReceive('params')->andReturn($this->config);
     $this->config->shouldReceive('save');
     $tool = new ModuleTool();
     $tool->addCommand('NewCommand');
     $cache = new ModuleCache();
     $cache->readFrom('mod', $tool);
     $this->assertEquals(array('commands' => array('NewCommand'), 'entity' => array()), $this->config->mod);
 }