mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 23:43:12 +00:00
Fix Typos
This commit is contained in:
@@ -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);
|
||||
|
@@ -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;
|
||||
|
@@ -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,21 +114,35 @@ 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
|
||||
)
|
||||
);
|
||||
|
||||
$this->assertEquals((int)$_GET['lili'], $parm['lili']);
|
||||
$this->assertEquals((int) $_GET['lili'], $parm['lili']);
|
||||
$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']);
|
||||
$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().
|
||||
*/
|
||||
@@ -145,7 +160,7 @@ class http_requestTest extends PHPUnit_Framework_TestCase
|
||||
public function testHas_post_datas()
|
||||
{
|
||||
$this->assertFalse($this->object->has_post_datas());
|
||||
$_POST = array('TOPPy'=>null);
|
||||
$_POST = array('TOPPy' => null);
|
||||
$this->assertTrue($this->object->has_post_datas());
|
||||
}
|
||||
|
||||
@@ -164,7 +179,7 @@ class http_requestTest extends PHPUnit_Framework_TestCase
|
||||
public function testHas_get_datas()
|
||||
{
|
||||
$this->assertFalse($this->object->has_get_datas());
|
||||
$_GET = array('TOPPy'=>null);
|
||||
$_GET = array('TOPPy' => null);
|
||||
$this->assertTrue($this->object->has_get_datas());
|
||||
}
|
||||
|
||||
@@ -175,13 +190,13 @@ class http_requestTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
$_POST = $_GET = array();
|
||||
$this->assertFalse($this->object->has_datas());
|
||||
$_POST = array('malal'=>true);
|
||||
$_POST = array('malal' => true);
|
||||
$this->assertTrue($this->object->has_datas());
|
||||
$_GET = array('malal'=>true);
|
||||
$_GET = array('malal' => true);
|
||||
$_POST = array();
|
||||
$this->assertTrue($this->object->has_datas());
|
||||
$_GET = array('malal'=>true);
|
||||
$_POST = array('malal'=>true);
|
||||
$_GET = array('malal' => true);
|
||||
$_POST = array('malal' => true);
|
||||
$this->assertTrue($this->object->has_datas());
|
||||
$_POST = $_GET = array();
|
||||
$this->assertFalse($this->object->has_datas());
|
||||
@@ -205,5 +220,4 @@ class http_requestTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
$this->assertTrue($this->object->is_command_line());
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -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'));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@@ -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());
|
||||
|
@@ -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());
|
||||
|
@@ -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());
|
||||
|
@@ -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());
|
||||
|
@@ -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());
|
||||
|
Reference in New Issue
Block a user