Compare commits
4 Commits
e8cccfd2ab
...
303a188e7c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
303a188e7c | ||
|
|
d5c5806767 | ||
|
|
6ac1889e35 | ||
|
|
b852888d61 |
@@ -10,10 +10,7 @@ namespace Domframework\Tests;
|
|||||||
|
|
||||||
use Domframework\Dblayeroo;
|
use Domframework\Dblayeroo;
|
||||||
|
|
||||||
class DblayerooTest
|
class DblayerooTest{ENGINE} extends \PHPUnit_Framework_TestCase
|
||||||
{
|
|
||||||
ENGINE
|
|
||||||
} extends \PHPUnit_Framework_TestCase
|
|
||||||
{
|
{
|
||||||
// Test with column name 'group', 'object', 'where', 'with space'
|
// Test with column name 'group', 'object', 'where', 'with space'
|
||||||
// Test with table name 'group', 'object', 'where', 'with space'
|
// Test with table name 'group', 'object', 'where', 'with space'
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ namespace Domframework\Tests;
|
|||||||
use Domframework\Xdiff;
|
use Domframework\Xdiff;
|
||||||
|
|
||||||
/** Test the domframework xdiff part */
|
/** Test the domframework xdiff part */
|
||||||
class xdiffTest extends \PHPUnit_Framework_TestCase
|
class XdiffTest extends \PHPUnit_Framework_TestCase
|
||||||
{
|
{
|
||||||
// Declaration of $string1 and $string2
|
// Declaration of $string1 and $string2
|
||||||
// {{{
|
// {{{
|
||||||
@@ -72,7 +72,7 @@ to this document.
|
|||||||
";
|
";
|
||||||
// }}}
|
// }}}
|
||||||
|
|
||||||
public function test_diff_normal_1()
|
public function testDiffNormal1()
|
||||||
{
|
{
|
||||||
// Mode normal
|
// Mode normal
|
||||||
$xdiff = new Xdiff();
|
$xdiff = new Xdiff();
|
||||||
@@ -102,7 +102,7 @@ to this document.
|
|||||||
");
|
");
|
||||||
}
|
}
|
||||||
|
|
||||||
public function test_diff_normal_2()
|
public function testDiffNormal2()
|
||||||
{
|
{
|
||||||
// Mode normal
|
// Mode normal
|
||||||
$xdiff = new Xdiff();
|
$xdiff = new Xdiff();
|
||||||
@@ -146,7 +146,7 @@ to this document.
|
|||||||
");
|
");
|
||||||
}
|
}
|
||||||
|
|
||||||
public function test_diff_normal_4()
|
public function testDiffNormal4()
|
||||||
{
|
{
|
||||||
// Mode normal
|
// Mode normal
|
||||||
$xdiff = new Xdiff();
|
$xdiff = new Xdiff();
|
||||||
@@ -158,14 +158,14 @@ to this document.
|
|||||||
");
|
");
|
||||||
}
|
}
|
||||||
|
|
||||||
public function test_diff_normal_5()
|
public function testDiffNormal5()
|
||||||
{
|
{
|
||||||
$xdiff = new Xdiff();
|
$xdiff = new Xdiff();
|
||||||
$res = $xdiff->diff("\n", "\n");
|
$res = $xdiff->diff("\n", "\n");
|
||||||
$this->assertSame($res, "");
|
$this->assertSame($res, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
public function test_diff_normal_6()
|
public function testDiffNormal6()
|
||||||
{
|
{
|
||||||
$xdiff = new Xdiff();
|
$xdiff = new Xdiff();
|
||||||
$res = $xdiff->diff("\n", "");
|
$res = $xdiff->diff("\n", "");
|
||||||
@@ -173,7 +173,7 @@ to this document.
|
|||||||
< \n");
|
< \n");
|
||||||
}
|
}
|
||||||
|
|
||||||
public function test_diff_normal_7()
|
public function testDiffNormal7()
|
||||||
{
|
{
|
||||||
$xdiff = new Xdiff();
|
$xdiff = new Xdiff();
|
||||||
$res = $xdiff->diff("", "\n");
|
$res = $xdiff->diff("", "\n");
|
||||||
@@ -181,7 +181,7 @@ to this document.
|
|||||||
> \n");
|
> \n");
|
||||||
}
|
}
|
||||||
|
|
||||||
public function test_diff_unified_1()
|
public function testDiffUnified1()
|
||||||
{
|
{
|
||||||
// Mode unified
|
// Mode unified
|
||||||
$xdiff = new Xdiff("unified");
|
$xdiff = new Xdiff("unified");
|
||||||
@@ -215,7 +215,7 @@ to this document.
|
|||||||
");
|
");
|
||||||
}
|
}
|
||||||
|
|
||||||
public function test_diff_unified_2()
|
public function testDiffUnified2()
|
||||||
{
|
{
|
||||||
// Mode unified
|
// Mode unified
|
||||||
$xdiff = new Xdiff("unified");
|
$xdiff = new Xdiff("unified");
|
||||||
@@ -247,7 +247,7 @@ to this document.
|
|||||||
");
|
");
|
||||||
}
|
}
|
||||||
|
|
||||||
public function test_diff_unified_3()
|
public function testDiffUnified3()
|
||||||
{
|
{
|
||||||
$xdiff = new Xdiff("unified");
|
$xdiff = new Xdiff("unified");
|
||||||
$res = $xdiff->diff("NEWLINE\n", "\n");
|
$res = $xdiff->diff("NEWLINE\n", "\n");
|
||||||
@@ -259,7 +259,7 @@ to this document.
|
|||||||
");
|
");
|
||||||
}
|
}
|
||||||
|
|
||||||
public function test_diff_unified_4()
|
public function testDiffUnified4()
|
||||||
{
|
{
|
||||||
$xdiff = new Xdiff("unified");
|
$xdiff = new Xdiff("unified");
|
||||||
$res = $xdiff->diff("\n", "NEWLINE\n");
|
$res = $xdiff->diff("\n", "NEWLINE\n");
|
||||||
@@ -271,14 +271,14 @@ to this document.
|
|||||||
");
|
");
|
||||||
}
|
}
|
||||||
|
|
||||||
public function test_diff_unified_5()
|
public function testDiffUnified5()
|
||||||
{
|
{
|
||||||
$xdiff = new Xdiff("unified");
|
$xdiff = new Xdiff("unified");
|
||||||
$res = $xdiff->diff("\n", "\n");
|
$res = $xdiff->diff("\n", "\n");
|
||||||
$this->assertSame($res, "");
|
$this->assertSame($res, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
public function test_diff_unified_6()
|
public function testDiffUnified6()
|
||||||
{
|
{
|
||||||
$xdiff = new Xdiff("unified");
|
$xdiff = new Xdiff("unified");
|
||||||
$res = $xdiff->diff("\n", "");
|
$res = $xdiff->diff("\n", "");
|
||||||
@@ -288,7 +288,7 @@ to this document.
|
|||||||
-\n");
|
-\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
public function test_diff_unified_7()
|
public function testDiffUnified7()
|
||||||
{
|
{
|
||||||
$xdiff = new Xdiff("unified");
|
$xdiff = new Xdiff("unified");
|
||||||
$res = $xdiff->diff("", "\n");
|
$res = $xdiff->diff("", "\n");
|
||||||
@@ -298,7 +298,7 @@ to this document.
|
|||||||
+\n");
|
+\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
public function test_diffFile_unified_1()
|
public function testDiffFileUnified1()
|
||||||
{
|
{
|
||||||
file_put_contents("/tmp/test_xdiff1", $this->string1);
|
file_put_contents("/tmp/test_xdiff1", $this->string1);
|
||||||
file_put_contents("/tmp/test_xdiff2", $this->string2);
|
file_put_contents("/tmp/test_xdiff2", $this->string2);
|
||||||
@@ -330,21 +330,21 @@ to this document.
|
|||||||
");
|
");
|
||||||
}
|
}
|
||||||
|
|
||||||
public function test_diffFile_unified_2()
|
public function testDiffFileUnified2()
|
||||||
{
|
{
|
||||||
$xdiff = new Xdiff("unified");
|
$xdiff = new Xdiff("unified");
|
||||||
$this->setExpectedException();
|
$this->setExpectedException();
|
||||||
$res = $xdiff->diffFile("/tmp/test_xdiffNOTEXISTS", "/tmp/test_xdiff2");
|
$res = $xdiff->diffFile("/tmp/test_xdiffNOTEXISTS", "/tmp/test_xdiff2");
|
||||||
}
|
}
|
||||||
|
|
||||||
public function test_diffFile_unified_3()
|
public function testDiffFileUnified3()
|
||||||
{
|
{
|
||||||
$xdiff = new Xdiff("unified");
|
$xdiff = new Xdiff("unified");
|
||||||
$this->setExpectedException();
|
$this->setExpectedException();
|
||||||
$res = $xdiff->diffFile("/tmp/test_xdiff1", "/tmp/test_xdiffNOTEXISTS");
|
$res = $xdiff->diffFile("/tmp/test_xdiff1", "/tmp/test_xdiffNOTEXISTS");
|
||||||
}
|
}
|
||||||
|
|
||||||
public function test_diffFile_sideBySide_1()
|
public function testDiffFileSideBySide1()
|
||||||
{
|
{
|
||||||
file_put_contents("/tmp/test_xdiff1", $this->string1);
|
file_put_contents("/tmp/test_xdiff1", $this->string1);
|
||||||
file_put_contents("/tmp/test_xdiff2", $this->string2);
|
file_put_contents("/tmp/test_xdiff2", $this->string2);
|
||||||
|
|||||||
@@ -60,7 +60,12 @@ class Convert
|
|||||||
return $inputDate;
|
return $inputDate;
|
||||||
}
|
}
|
||||||
$errors = $date->getLastErrors();
|
$errors = $date->getLastErrors();
|
||||||
if ($errors["warning_count"] > 0 || $errors["error_count"] > 0) {
|
if (
|
||||||
|
$errors !== false && (
|
||||||
|
$errors["warning_count"] > 0 ||
|
||||||
|
$errors["error_count"] > 0
|
||||||
|
)
|
||||||
|
) {
|
||||||
if ($exception === true) {
|
if ($exception === true) {
|
||||||
throw new \Exception(
|
throw new \Exception(
|
||||||
"Invalid date provided or not matching the format",
|
"Invalid date provided or not matching the format",
|
||||||
|
|||||||
@@ -1472,11 +1472,11 @@ class Dblayeroo
|
|||||||
$this->DBException("Parameter foreign invalid: " .
|
$this->DBException("Parameter foreign invalid: " .
|
||||||
"parameter 1 is not a string");
|
"parameter 1 is not a string");
|
||||||
}
|
}
|
||||||
if (mb_strlen($params[0] > 64)) {
|
if (mb_strlen($params[0]) > 64) {
|
||||||
$this->DBException("Parameter foreign invalid: " .
|
$this->DBException("Parameter foreign invalid: " .
|
||||||
"parameter 0 is too long");
|
"parameter 0 is too long");
|
||||||
}
|
}
|
||||||
if (mb_strlen($params[1] > 64)) {
|
if (mb_strlen($params[1]) > 64) {
|
||||||
$this->DBException("Parameter foreign invalid: " .
|
$this->DBException("Parameter foreign invalid: " .
|
||||||
"parameter 1 is too long");
|
"parameter 1 is too long");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user