Test unitaires de demo
This commit is contained in:
parent
a074328fae
commit
1c627d243f
|
@ -224,7 +224,7 @@ class m_ftp {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Explicitly look for only allowed chars
|
// Explicitly look for only allowed chars
|
||||||
if ( ! preg_match("/^[A-Za-z0-9_\.\-]+$/", $l) ) {
|
if ( ! preg_match("/^[A-Za-z0-9]+[A-Za-z0-9_\.\-]*$/", $l) ) {
|
||||||
$err->raise('ftp', _("FTP login is incorrect"));
|
$err->raise('ftp', _("FTP login is incorrect"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -118,10 +118,13 @@ class m_ftpTest extends PHPUnit_Framework_TestCase
|
||||||
*/
|
*/
|
||||||
public function testCheck_login()
|
public function testCheck_login()
|
||||||
{
|
{
|
||||||
// Remove the following lines when you implement this test.
|
// Allowed
|
||||||
$this->markTestIncomplete(
|
$this->assertTrue($this->object->check_login('plop'));
|
||||||
'This test has not been implemented yet.'
|
$this->assertTrue($this->object->check_login('00'));
|
||||||
);
|
|
||||||
|
// Forbidden
|
||||||
|
$this->assertFalse($this->object->check_login('_plop'));
|
||||||
|
$this->assertFalse($this->object->check_login('arf+'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -238,9 +241,6 @@ class m_ftpTest extends PHPUnit_Framework_TestCase
|
||||||
*/
|
*/
|
||||||
public function testHook_upnp_list()
|
public function testHook_upnp_list()
|
||||||
{
|
{
|
||||||
// Remove the following lines when you implement this test.
|
$this->assertArrayHasKey('ftp', $this->object->hook_upnp_list());
|
||||||
$this->markTestIncomplete(
|
|
||||||
'This test has not been implemented yet.'
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue