<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
/*
* @package Runemaster
* @copyright 2008 KUMAKURA Yousuke All rights reserved.
* @version SVN: $Id: PluginSpec.php 42 2008-08-20 15:33:33Z kumatch $
* @since File available since Release 0.1.0
*/
require_once dirname(__FILE__) . '/prepare.php';
// {{{ Describeãã©ã°ã¤ã³
/**
* ãã©ã°ã¤ã³ã«é¢ããSpec
*
* @package Runemaster
* @copyright 2008 KUMAKURA Yousuke All rights reserved.
* @version Release: @package_version@
* @since Class available since Release 0.1.0
*/
class Describeãã©ã°ã¤ã³ extends SpecCommon
{
// {{{ properties
/**#@+
* @access public
*/
/**#@-*/
/**#@+
* @access protected
*/
/**#@-*/
/**#@+
* @access private
*/
/**#@-*/
/**#@+
* @access public
*/
public function itå©ç¨ãããã©ã°ã¤ã³ã®ã¨ã³ããªãªã¹ããåå¾ã§ãã()
{
$master = $this->_master;
$spells = $master->listSpell();
$this->spec(is_array($spells))->should->beTrue();
$this->spec(count($spells))->should->be(7);
}
public function itå©ç¨ãããã©ã°ã¤ã³ã®ã¨ã³ããªã夿´ã§ãã()
{
$master = $this->_master;
$master->assign(array('foo' => 'Bar'));
$display = rendererInTest($master, 'Plugin/Change');
$result = file_get_contents('./results/Plugin/Change1.html');
$this->spec($display)->should->be($result);
$spells = $master->listSpell();
$newSpells = array();
foreach ($spells as $spell) {
if ($spell !== 'Rune_Spell_Variable') {
array_push($newSpells, $spell);
}
}
$this->before();
try {
$master = $this->_master;
$master->setSpells($newSpells);
$master->assign(array('foo' => 'Baz'));
} catch (Exception $e) {
return;
}
$this->fail();
}
public function itãªãªã¸ãã«ãã©ã°ã¤ã³ã追å ã§ãã()
{
set_include_path(realpath(dirname(__FILE__) . '/lib') .
PATH_SEPARATOR . get_include_path()
);
$master = $this->_master;
$master->addSpell('ExampleSpell');
$master->testExampleSpell('Changed by original spell.');
$display = rendererInTest($master, 'Plugin/Add');
$result = file_get_contents('./results/Plugin/Add.html');
$this->spec($display)->should->be($result);
}
/**#@-*/
/**#@+
* @access protected
*/
/**#@-*/
/**#@+
* @access private
*/
/**#@-*/
// }}}
}
// }}}
/*
* Local Variables:
* mode: php
* coding: utf-8
* tab-width: 4
* c-basic-offset: 4
* c-hanging-comment-ender-p: nil
* indent-tabs-mode: nil
* End:
*/
?>