mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
b717167c4f
- Time::daysAsSql returns SQL limits for a set of days, perhaps should be in DBO, - cleanups git-svn-id: https://svn.cakephp.org/repo/trunk/cake@259 3807eeeb-6ff5-0310-8944-8be069107fe0
60 lines
No EOL
1.2 KiB
PHP
60 lines
No EOL
1.2 KiB
PHP
<?PHP
|
|
|
|
uses('narray');
|
|
|
|
class NarrayTest extends UnitTestCase
|
|
{
|
|
var $narray;
|
|
|
|
// constructor of the test suite
|
|
function NarrayTest()
|
|
{
|
|
$this->UnitTestCase('Narray test');
|
|
}
|
|
|
|
// called before the test functions will be executed
|
|
// this function is defined in PHPUnit_TestCase and overwritten
|
|
// here
|
|
function setUp()
|
|
{
|
|
$this->narray = new Narray();
|
|
}
|
|
|
|
// called after the test functions are executed
|
|
// this function is defined in PHPUnit_TestCase and overwritten
|
|
// here
|
|
function tearDown()
|
|
{
|
|
unset($this->narray);
|
|
}
|
|
|
|
|
|
function testInArray()
|
|
{
|
|
$a = array('foo'=>' bar ', 'i-am'=>'a');
|
|
$b = array('foo'=>'bar ', 'i-am'=>'b');
|
|
$c = array('foo'=>' bar', 'i-am'=>'c');
|
|
$d = array('foo'=>'bar', 'i-am'=>'d');
|
|
|
|
$n = new Narray(array($a, $b, $c, $d));
|
|
|
|
$result = $n->findIn('foo', ' bar ');
|
|
$expected = array(0=>$a);
|
|
$this->assertEqual($result, $expected);
|
|
|
|
$result = $n->findIn('foo', 'bar ');
|
|
$expected = array(1=>$b);
|
|
$this->assertEqual($result, $expected);
|
|
|
|
$result = $n->findIn('foo', ' bar');
|
|
$expected = array(2=>$c);
|
|
$this->assertEqual($result, $expected);
|
|
|
|
$result = $n->findIn('foo', 'bar');
|
|
$expected = array(3=>$d);
|
|
$this->assertEqual($result, $expected);
|
|
}
|
|
|
|
}
|
|
|
|
?>
|