pluf2

pluf2 Commit Details


Date:2010-10-01 09:27:50 (14 years 2 months ago)
Author:Mehdi Kabab
Branch:master
Commit:7570577a1121a234523a5d7501976cb66c2f9cbd
Parents: bfeca2aa27989847e96c81a0822439b619fa415b
Message:Do not crash unit tests when APC is not installed. Also fixed a notice.

Changes:

File differences

src/Pluf/Tests/Dispatch/Dispatcher.php
3232
3333
3434
35
35
3636
3737
3838
......
4242
4343
4444
45
45
4646
4747
4848
......
7878
7979
8080
81
81
82
8283
8384
8485
......
145146
146147
147148
148
149
150
149151
150152
151153
function setUp()
{
$this->views = $GLOBALS['_PX_views'];
$this->views = (isset($GLOBALS['_PX_views'])) ? $GLOBALS['_PX_views'] : array();
}
function tearDown()
function hello()
{
return true;
return new Pluf_HTTP_Response('ok');
}
function hello1()
$req1 = (object) array('query' => '/hello/'); // match
$req2 = (object) array('query' => '/hello'); // match second pass
$req3 = (object) array('query' => '/hello/you/'); // no match
$this->assertIdentical(true, Pluf_Dispatcher::match($req1));
$this->assertIdentical(200, Pluf_Dispatcher::match($req1)->status_code);
$this->assertEqual('ok', Pluf_Dispatcher::match($req1)->content);
$this->assertIsA(Pluf_Dispatcher::match($req2),
'Pluf_HTTP_Response_Redirect');
$this->assertIsA(Pluf_Dispatcher::match($req3),
$h2 = (object) array('query' => '/hello2/world/'); // match
$h3 = (object) array('query' => '/hello/'); // match
$h4 = (object) array('query' => '/hello/hello/'); // match
$this->assertIdentical(true, Pluf_Dispatcher::match($req1));
$this->assertIdentical(200, Pluf_Dispatcher::match($req1)->status_code);
$this->assertEqual('ok', Pluf_Dispatcher::match($req1)->content);
$this->assertIdentical(1, Pluf_Dispatcher::match($h1));
$this->assertIdentical(2, Pluf_Dispatcher::match($h2));
$this->assertIdentical(3, Pluf_Dispatcher::match($h3));
src/testrunner.php
120120
121121
122122
123
124
125
123126
124127
125128
}
$test = &new GroupTest(sprintf('All tests for application %s.', $app));
foreach ($files as $t) {
if (!function_exists('apc_store') && 'Pluf_Tests_Cache_Apc' === $t[1]) {
continue;
}
$test->addTestCase(new $t[1]());
}
$reporter = new TextReporter();

Archive Download the corresponding diff file

Branches

Number of commits:
Page rendered in 0.05648s using 13 queries.