Commit 8e49b671 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Fix unit test

parent 744778d3
Pipeline #1524 passed with stage
in 2 minutes and 2 seconds
...@@ -14,8 +14,7 @@ use PHPUnit\Framework\TestCase; ...@@ -14,8 +14,7 @@ use PHPUnit\Framework\TestCase;
* Class OnStringTest * Class OnStringTest
* @package qfq * @package qfq
*/ */
class OnStringTest extends TestCase class OnStringTest extends TestCase {
{
/** /**
* *
...@@ -83,8 +82,8 @@ class OnStringTest extends TestCase ...@@ -83,8 +82,8 @@ class OnStringTest extends TestCase
* @throws UserFormException * @throws UserFormException
*/ */
public function testExtractFormRecordId() { public function testExtractFormRecordId() {
$arrId=array(); $arrId = array();
$arrForm=array(); $arrForm = array();
$this->assertEquals('', OnString::splitPathInfoToIdForm('', $arrId, $arrForm)); $this->assertEquals('', OnString::splitPathInfoToIdForm('', $arrId, $arrForm));
$this->assertEquals([], $arrId); $this->assertEquals([], $arrId);
...@@ -119,12 +118,12 @@ class OnStringTest extends TestCase ...@@ -119,12 +118,12 @@ class OnStringTest extends TestCase
$this->assertEquals(['path1'], $arrForm); $this->assertEquals(['path1'], $arrForm);
$this->assertEquals('path2', OnString::splitPathInfoToIdForm('/path1/12/path2', $arrId, $arrForm)); $this->assertEquals('path2', OnString::splitPathInfoToIdForm('/path1/12/path2', $arrId, $arrForm));
$this->assertEquals([12,0], $arrId); $this->assertEquals([12, 0], $arrId);
$this->assertEquals(['path1','path2'], $arrForm); $this->assertEquals(['path1', 'path2'], $arrForm);
$this->assertEquals('path2', OnString::splitPathInfoToIdForm('/path1/12/path2/34', $arrId, $arrForm)); $this->assertEquals('path2', OnString::splitPathInfoToIdForm('/path1/12/path2/34', $arrId, $arrForm));
$this->assertEquals([12,34], $arrId); $this->assertEquals([12, 34], $arrId);
$this->assertEquals(['path1','path2'], $arrForm); $this->assertEquals(['path1', 'path2'], $arrForm);
} }
...@@ -133,8 +132,11 @@ class OnStringTest extends TestCase ...@@ -133,8 +132,11 @@ class OnStringTest extends TestCase
* *
*/ */
public function testExtractFormRecordId_1() { public function testExtractFormRecordId_1() {
$arrId = array();
$arrForm = array();
# An alnum string is requested as path # An alnum string is requested as path
$this->assertEquals('', OnString::splitPathInfoToIdForm('/%')); $this->assertEquals('', OnString::splitPathInfoToIdForm('/%', $arrId, $arrForm));
} }
/** /**
...@@ -142,8 +144,11 @@ class OnStringTest extends TestCase ...@@ -142,8 +144,11 @@ class OnStringTest extends TestCase
* *
*/ */
public function testExtractFormRecordId_2() { public function testExtractFormRecordId_2() {
$arrId = array();
$arrForm = array();
# A numerical value is requested as id # A numerical value is requested as id
$this->assertEquals('', OnString::splitPathInfoToIdForm('/path1/path2')); $this->assertEquals('', OnString::splitPathInfoToIdForm('/path1/path2', $arrId, $arrForm));
} }
/** /**
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment