Fix Typos

This commit is contained in:
Romain Neutron
2012-04-28 13:40:37 +02:00
parent 6911718c46
commit 005937fdc3
9 changed files with 335 additions and 302 deletions

View File

@@ -213,7 +213,7 @@ class ControllerRssFeedTest extends \PhraseanetWebTestCaseAbstract
protected function evaluateAtom(Response $response)
{
$dom_doc = new DOMDocument();
$doc->preserveWhiteSpace = false;
$dom_doc->preserveWhiteSpace = false;
$dom_doc->loadXML($response->getContent());
$xpath = new DOMXPath($dom_doc);

View File

@@ -19,7 +19,7 @@ class Feed_XML_RSS_ImageTest extends PhraseanetPHPUnitAbstract
public function setUp()
{
parent::setUp();
$this->this->link = 'http://www.example.org';
$this->link = 'http://www.example.org';
$this->title = 'Un beau titre';
$this->url = 'http://www.example.org/image.jpg';
$this->width = 42;

View File

@@ -4,7 +4,6 @@ require_once __DIR__ . '/../PhraseanetPHPUnitAbstract.class.inc';
class http_requestTest extends PHPUnit_Framework_TestCase
{
/**
* @var http_request
*/
@@ -101,7 +100,9 @@ class http_requestTest extends PHPUnit_Framework_TestCase
{
$_GET = array('lili' => '25', 'popo' => array('tip', 'top'));
$_POST = array('Plili' => '25', 'Gpopo' => array('mtip', 'btop'));
$parm = $this->object->get_parms('lili', 'Plili', 'popo', 'Gpopo', 'notexists');
$this->assertEquals($_GET['lili'], $parm['lili']);
$this->assertEquals($_POST['Plili'], $parm['Plili']);
$this->assertEquals($_GET['popo'], $parm['popo']);
@@ -113,7 +114,6 @@ class http_requestTest extends PHPUnit_Framework_TestCase
'lili' => http_request::SANITIZE_NUMBER_INT
, 'Plili'
, 'popo'
, 'Gpopo' => http_request::SANITIZE_STRING
, 'notexists' => http_request::SANITIZE_STRING
)
);
@@ -122,12 +122,27 @@ class http_requestTest extends PHPUnit_Framework_TestCase
$this->assertTrue(is_int($parm['lili']));
$this->assertEquals($_POST['Plili'], $parm['Plili']);
$this->assertEquals($_GET['popo'], $parm['popo']);
$this->assertEquals('Array', $parm['Gpopo']);
$this->assertEquals('', $parm['notexists']);
$_GET = $_POST = array();
}
public function testGet_parmsArraToString()
{
$_POST = array('Plili' => '25', 'Gpopo' => array('mtip', 'btop'));
try {
$this->object->get_parms(array('Gpopo' => http_request::SANITIZE_STRING));
if (version_compare(PHP_VERSION, '5.4', '>=')) {
$this->fail('Should raise an error notice');
}
} catch (\PHPUnit_Framework_Error_Notice $e) {
}
$_GET = $_POST = array();
}
/**
* @todo Implement testGet_parms_from_serialized_datas().
*/
@@ -205,5 +220,4 @@ class http_requestTest extends PHPUnit_Framework_TestCase
{
$this->assertTrue($this->object->is_command_line());
}
}

View File

@@ -4,7 +4,6 @@ require_once __DIR__ . '/PhraseanetPHPUnitAbstract.class.inc';
class registryTest extends PhraseanetPHPUnitAbstract
{
/**
* @var registry
*/
@@ -35,10 +34,6 @@ class registryTest extends PhraseanetPHPUnitAbstract
$this->object->set('key_test', '1', registry::TYPE_STRING);
$this->assertTrue($this->object->get('key_test') === '1');
$this->object->set('key_test', array('caca'), registry::TYPE_STRING);
$this->assertTrue($this->object->get('key_test') === 'Array');
/**
* Set value with type (string)
*/
@@ -51,9 +46,6 @@ class registryTest extends PhraseanetPHPUnitAbstract
$this->object->set('key_test', '1', registry::TYPE_STRING);
$this->assertTrue($this->object->get('key_test') === '1');
$this->object->set('key_test', array('caca'), registry::TYPE_STRING);
$this->assertTrue($this->object->get('key_test') === 'Array');
/**
* Set value with type (int)
*/
@@ -151,6 +143,34 @@ class registryTest extends PhraseanetPHPUnitAbstract
$this->assertTrue($this->object->get('key_test') === array(true));
}
public function testSetArrayToString()
{
try {
$this->object->set('key_test', array('caca'), registry::TYPE_STRING);
if (version_compare(PHP_VERSION, '5.4', '>=')) {
$this->fail('Should raise an error notice');
}
$this->assertTrue($this->object->get('key_test') === 'Array');
} catch (\PHPUnit_Framework_Error_Notice $e) {
}
try {
$this->object->set('key_test', array('caca'), registry::TYPE_STRING);
if (version_compare(PHP_VERSION, '5.4', '>=')) {
$this->fail('Should raise an error notice');
}
$this->assertTrue($this->object->get('key_test') === 'Array');
} catch (\PHPUnit_Framework_Error_Notice $e) {
}
}
public function testIs_set()
{
$this->object->set('key_test', 'value', registry::TYPE_STRING);
@@ -164,6 +184,5 @@ class registryTest extends PhraseanetPHPUnitAbstract
$this->object->un_set('key_test');
$this->assertFalse($this->object->is_set('key_test'));
}
}

View File

@@ -29,7 +29,7 @@ class connexionReportTest extends PhraseanetPHPUnitAbstract
public function setUp()
{
$date = new Datetime();
$thid->dmax = $date->format("Y-m-d H:i:s");
$this->dmax = $date->format("Y-m-d H:i:s");
$date->modify('-6 month');
$this->dmin = $date->format("Y-m-d H:i:s");
$appbox = appbox::get_instance(\bootstrap::getCore());

View File

@@ -28,7 +28,7 @@ class downloadReportTest extends PhraseanetPHPUnitAbstract
public function setUp()
{
$date = new Datetime();
$thid->dmax = $date->format("Y-m-d H:i:s");
$this->dmax = $date->format("Y-m-d H:i:s");
$date->modify('-6 month');
$this->dmin = $date->format("Y-m-d H:i:s");
$appbox = appbox::get_instance(\bootstrap::getCore());

View File

@@ -28,7 +28,7 @@ class filterTest extends PhraseanetPHPUnitAbstract
public function setup()
{
$date = new Datetime();
$thid->dmax = $date->format("Y-m-d H:i:s");
$this->dmax = $date->format("Y-m-d H:i:s");
$date->modify('-6 month');
$this->dmin = $date->format("Y-m-d H:i:s");
$appbox = appbox::get_instance(\bootstrap::getCore());

View File

@@ -28,7 +28,7 @@ class questionReportTest extends PhraseanetPHPUnitAbstract
public function setUp()
{
$date = new Datetime();
$thid->dmax = $date->format("Y-m-d H:i:s");
$this->dmax = $date->format("Y-m-d H:i:s");
$date->modify('-6 month');
$this->dmin = $date->format("Y-m-d H:i:s");
$appbox = appbox::get_instance(\bootstrap::getCore());

View File

@@ -41,7 +41,7 @@ class reportTest extends PhraseanetPHPUnitAbstract
</description>
</record>';
$date = new Datetime();
$thid->dmax = $date->format("Y-m-d H:i:s");
$this->dmax = $date->format("Y-m-d H:i:s");
$date->modify('-6 month');
$this->dmin = $date->format("Y-m-d H:i:s");
$appbox = appbox::get_instance(\bootstrap::getCore());