Example #1
0
 /**
  * Test creating config files for the mod
  *
  * @return void
  * @author Dan Cox
  */
 public function test_createConfigurationFiles()
 {
     $this->config->shouldReceive('create')->andReturn($this->config);
     $this->config->shouldReceive('params')->andReturn($this->config);
     $this->config->shouldReceive('save');
     $tool = new ModuleTool();
     $tool->config(['test' => 'value']);
     $this->assertEquals('value', $this->config->test);
 }
Example #2
0
 /**
  * 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);
 }
Example #3
0
 /**
  * Reads settings from the mod tool
  *
  * @return void
  * @author Dan Cox
  */
 public function readFrom($name, ModuleTool $modTool)
 {
     $this->settings = $modTool->toArray();
     $this->write($name);
 }