This commit is contained in:
Ilya Sigunov
2011-10-21 11:21:25 +04:00
parent 45c89d3f00
commit acb3b8bf27
3 changed files with 51 additions and 224 deletions

View File

@ -9,9 +9,6 @@
* @filesource $URL$
*/
require_once dirname(__FILE__) . '/../../form/Form.php';
require_once dirname(__FILE__) . '/../../form/FormField.php';
require_once dirname(__FILE__) . '/../../view/iView.php';
require_once dirname(__FILE__) . '/../../view/PHPView.php';
require_once dirname(__FILE__) . '/../../view/helpers/ViewHelper.php';
@ -23,11 +20,8 @@ class FormViewHelperTest extends PHPUnit_Framework_TestCase
public function setUp()
{
Session::start();
$phpview = new PHPView(array('path' => 'document_root'));
$this->form = new FormViewHelper($phpview);
$_SESSION['path'] = array(
'values'=>array(
'path'=>'path'
@ -41,44 +35,37 @@ class FormViewHelperTest extends PHPUnit_Framework_TestCase
public function testForm2()
{
$this->assertNull($this->assertAttributeEquals(null,'data',$this->form));
$this->setExpectedException('Exception');
$this->form->form(null);
}
public function testForm1()
{
$this->assertNull($this->assertAttributeEquals(null,'data',$this->form)); //аналог getProp
$this->form->form('path');
}
public function testValueIsset()
{
$this->form->form('path');
$this->assertEquals('path', $this->form->value('path'));
}
public function testValueNotIsset()
{
$this->form->form('path');
$this->assertEquals('param2', $this->form->value('param1','param2'));
}
public function testMessageIsset()
{
$this->form->form('path');
$this->assertNotEmpty($this->form->message('path'));
}
public function testMessageNotIsset()
{
$this->form->form('path');
$this->assertEmpty($this->form->message(''));
}
}