|
@ -92,8 +92,7 @@ class FormTest extends PHPUnit_Framework_TestCase |
|
|
$this->assertSame(1, $form->isValid($fields)); |
|
|
$this->assertSame(1, $form->isValid($fields)); |
|
|
$this->assertEquals($fields, $form->getValues()); |
|
|
$this->assertEquals($fields, $form->getValues()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function testGetValueCorrect() |
|
|
public function testGetValueCorrect() |
|
|
{ |
|
|
{ |
|
|
$form = new NotEmptyForm(); |
|
|
$form = new NotEmptyForm(); |
|
@ -106,7 +105,6 @@ class FormTest extends PHPUnit_Framework_TestCase |
|
|
$this->assertEquals($fields['password'], $form->getValue('password')); |
|
|
$this->assertEquals($fields['password'], $form->getValue('password')); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function testGetValueMissing() |
|
|
public function testGetValueMissing() |
|
|
{ |
|
|
{ |
|
|
$form = new NotEmptyForm(); |
|
|
$form = new NotEmptyForm(); |
|
@ -118,7 +116,6 @@ class FormTest extends PHPUnit_Framework_TestCase |
|
|
$this->assertEquals('', $form->getValue('password')); |
|
|
$this->assertEquals('', $form->getValue('password')); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function testGetValueMissingFieldLogin() |
|
|
public function testGetValueMissingFieldLogin() |
|
|
{ |
|
|
{ |
|
|
$form = new NotEmptyForm(); |
|
|
$form = new NotEmptyForm(); |
|
@ -130,7 +127,6 @@ class FormTest extends PHPUnit_Framework_TestCase |
|
|
$this->assertEquals('', $form->getValue('passwordw')); |
|
|
$this->assertEquals('', $form->getValue('passwordw')); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function testGetValueMissingFieldPassword() |
|
|
public function testGetValueMissingFieldPassword() |
|
|
{ |
|
|
{ |
|
|
$form = new NotEmptyForm(); |
|
|
$form = new NotEmptyForm(); |
|
@ -166,7 +162,6 @@ class FormTest extends PHPUnit_Framework_TestCase |
|
|
$this->assertEquals($form->getMessageType(), Form::ERROR); |
|
|
$this->assertEquals($form->getMessageType(), Form::ERROR); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function testGetMessageCorrect() |
|
|
public function testGetMessageCorrect() |
|
|
{ |
|
|
{ |
|
|
$form = new NotEmptyForm(); |
|
|
$form = new NotEmptyForm(); |
|
@ -179,7 +174,6 @@ class FormTest extends PHPUnit_Framework_TestCase |
|
|
$this->assertEquals('message', $form->getMessage()); |
|
|
$this->assertEquals('message', $form->getMessage()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function testGetMessageMissing() |
|
|
public function testGetMessageMissing() |
|
|
{ |
|
|
{ |
|
|
$form = new NotEmptyForm(); |
|
|
$form = new NotEmptyForm(); |
|
@ -191,7 +185,6 @@ class FormTest extends PHPUnit_Framework_TestCase |
|
|
$this->assertEquals('message', $form->getMessage()); |
|
|
$this->assertEquals('message', $form->getMessage()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function testSetSuccessMessage() |
|
|
public function testSetSuccessMessage() |
|
|
{ |
|
|
{ |
|
|
$form = new NotEmptyForm(); |
|
|
$form = new NotEmptyForm(); |
|
@ -233,33 +226,4 @@ class NotEmptyForm extends Form |
|
|
$validator->setMessage('Enter your password.'); |
|
|
$validator->setMessage('Enter your password.'); |
|
|
$this->addField('password')->addValidator($validator); |
|
|
$this->addField('password')->addValidator($validator); |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
class NullForm extends Form |
|
|
|
|
|
{ |
|
|
|
|
|
public function init() |
|
|
|
|
|
{ |
|
|
|
|
|
/**/ |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class FooTest extends PHPUnit_Framework_TestCase |
|
|
|
|
|
{ |
|
|
|
|
|
/** |
|
|
|
|
|
* @covers Foo::doSomethingPrivate |
|
|
|
|
|
*/ |
|
|
|
|
|
public function testPrivateMethod() |
|
|
|
|
|
{ |
|
|
|
|
|
$method = new ReflectionMethod( |
|
|
|
|
|
'Foo', 'doSomethingPrivate' |
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
$method->setAccessible(TRUE); |
|
|
|
|
|
|
|
|
|
|
|
$this->assertEquals( |
|
|
|
|
|
'blah', $method->invoke(new Foo) |
|
|
|
|
|
); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |