|
|
@ -92,8 +92,7 @@ class FormTest extends PHPUnit_Framework_TestCase |
|
|
|
$this->assertSame(1, $form->isValid($fields)); |
|
|
|
$this->assertEquals($fields, $form->getValues()); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function testGetValueCorrect() |
|
|
|
{ |
|
|
|
$form = new NotEmptyForm(); |
|
|
@ -106,7 +105,6 @@ class FormTest extends PHPUnit_Framework_TestCase |
|
|
|
$this->assertEquals($fields['password'], $form->getValue('password')); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public function testGetValueMissing() |
|
|
|
{ |
|
|
|
$form = new NotEmptyForm(); |
|
|
@ -118,7 +116,6 @@ class FormTest extends PHPUnit_Framework_TestCase |
|
|
|
$this->assertEquals('', $form->getValue('password')); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public function testGetValueMissingFieldLogin() |
|
|
|
{ |
|
|
|
$form = new NotEmptyForm(); |
|
|
@ -130,7 +127,6 @@ class FormTest extends PHPUnit_Framework_TestCase |
|
|
|
$this->assertEquals('', $form->getValue('passwordw')); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public function testGetValueMissingFieldPassword() |
|
|
|
{ |
|
|
|
$form = new NotEmptyForm(); |
|
|
@ -166,7 +162,6 @@ class FormTest extends PHPUnit_Framework_TestCase |
|
|
|
$this->assertEquals($form->getMessageType(), Form::ERROR); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public function testGetMessageCorrect() |
|
|
|
{ |
|
|
|
$form = new NotEmptyForm(); |
|
|
@ -179,7 +174,6 @@ class FormTest extends PHPUnit_Framework_TestCase |
|
|
|
$this->assertEquals('message', $form->getMessage()); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public function testGetMessageMissing() |
|
|
|
{ |
|
|
|
$form = new NotEmptyForm(); |
|
|
@ -191,7 +185,6 @@ class FormTest extends PHPUnit_Framework_TestCase |
|
|
|
$this->assertEquals('message', $form->getMessage()); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public function testSetSuccessMessage() |
|
|
|
{ |
|
|
|
$form = new NotEmptyForm(); |
|
|
@ -233,33 +226,4 @@ class NotEmptyForm extends Form |
|
|
|
$validator->setMessage('Enter your password.'); |
|
|
|
$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) |
|
|
|
); |
|
|
|
} |
|
|
|
} |