mirror of
https://github.com/wiosna-dev/common-library.git
synced 2026-03-12 09:31:51 +01:00
Tests > use "Meritoo\Test\Common" namespace (instead of "Meritoo\Common\Test")
This commit is contained in:
@@ -6,6 +6,7 @@ Common and useful classes, methods, exceptions etc.
|
|||||||
|
|
||||||
1. Arrays > refactoring & more tests
|
1. Arrays > refactoring & more tests
|
||||||
2. ValueObject > Human > represents a human
|
2. ValueObject > Human > represents a human
|
||||||
|
3. Tests > use `Meritoo\Test\Common` namespace (instead of `Meritoo\Common\Test`)
|
||||||
|
|
||||||
# 0.1.5
|
# 0.1.5
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
},
|
},
|
||||||
"autoload-dev": {
|
"autoload-dev": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"Meritoo\\Common\\Test\\": "tests/"
|
"Meritoo\\Test\\Common\\": "tests/"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Meritoo\Common\Test\Collection;
|
namespace Meritoo\Test\Common\Collection;
|
||||||
|
|
||||||
use ArrayIterator;
|
use ArrayIterator;
|
||||||
use Generator;
|
use Generator;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Meritoo\Common\Test\Exception\Base;
|
namespace Meritoo\Test\Common\Exception\Base;
|
||||||
|
|
||||||
use Meritoo\Common\Exception\Base\UnknownTypeException;
|
use Meritoo\Common\Exception\Base\UnknownTypeException;
|
||||||
use Meritoo\Common\Test\Base\BaseTestCase;
|
use Meritoo\Common\Test\Base\BaseTestCase;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Meritoo\Common\Test\Exception\Bundle;
|
namespace Meritoo\Test\Common\Exception\Bundle;
|
||||||
|
|
||||||
use Meritoo\Common\Exception\Bundle\IncorrectBundleNameException;
|
use Meritoo\Common\Exception\Bundle\IncorrectBundleNameException;
|
||||||
use Meritoo\Common\Test\Base\BaseTestCase;
|
use Meritoo\Common\Test\Base\BaseTestCase;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Meritoo\Common\Test\Exception\Date;
|
namespace Meritoo\Test\Common\Exception\Date;
|
||||||
|
|
||||||
use Generator;
|
use Generator;
|
||||||
use Meritoo\Common\Exception\Type\UnknownDatePartTypeException;
|
use Meritoo\Common\Exception\Type\UnknownDatePartTypeException;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Meritoo\Common\Test\Exception\File;
|
namespace Meritoo\Test\Common\Exception\File;
|
||||||
|
|
||||||
use Generator;
|
use Generator;
|
||||||
use Meritoo\Common\Exception\File\EmptyFileException;
|
use Meritoo\Common\Exception\File\EmptyFileException;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Meritoo\Common\Test\Exception\File;
|
namespace Meritoo\Test\Common\Exception\File;
|
||||||
|
|
||||||
use Meritoo\Common\Exception\File\EmptyFilePathException;
|
use Meritoo\Common\Exception\File\EmptyFilePathException;
|
||||||
use Meritoo\Common\Test\Base\BaseTestCase;
|
use Meritoo\Common\Test\Base\BaseTestCase;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Meritoo\Common\Test\Exception\File;
|
namespace Meritoo\Test\Common\Exception\File;
|
||||||
|
|
||||||
use Generator;
|
use Generator;
|
||||||
use Meritoo\Common\Exception\File\NotExistingFileException;
|
use Meritoo\Common\Exception\File\NotExistingFileException;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Meritoo\Common\Test\Exception\Method;
|
namespace Meritoo\Test\Common\Exception\Method;
|
||||||
|
|
||||||
use Generator;
|
use Generator;
|
||||||
use Meritoo\Common\Exception\Method\DisabledMethodException;
|
use Meritoo\Common\Exception\Method\DisabledMethodException;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Meritoo\Common\Test\Exception\Reflection;
|
namespace Meritoo\Test\Common\Exception\Reflection;
|
||||||
|
|
||||||
use Generator;
|
use Generator;
|
||||||
use Meritoo\Common\Exception\Reflection\CannotResolveClassNameException;
|
use Meritoo\Common\Exception\Reflection\CannotResolveClassNameException;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Meritoo\Common\Test\Exception\Reflection;
|
namespace Meritoo\Test\Common\Exception\Reflection;
|
||||||
|
|
||||||
use Generator;
|
use Generator;
|
||||||
use Meritoo\Common\Exception\Reflection\MissingChildClassesException;
|
use Meritoo\Common\Exception\Reflection\MissingChildClassesException;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Meritoo\Common\Test\Exception\Reflection;
|
namespace Meritoo\Test\Common\Exception\Reflection;
|
||||||
|
|
||||||
use Meritoo\Common\Exception\Reflection\NotExistingPropertyException;
|
use Meritoo\Common\Exception\Reflection\NotExistingPropertyException;
|
||||||
use Meritoo\Common\Test\Base\BaseTestCase;
|
use Meritoo\Common\Test\Base\BaseTestCase;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Meritoo\Common\Test\Exception\Reflection;
|
namespace Meritoo\Test\Common\Exception\Reflection;
|
||||||
|
|
||||||
use Generator;
|
use Generator;
|
||||||
use Meritoo\Common\Exception\Reflection\TooManyChildClassesException;
|
use Meritoo\Common\Exception\Reflection\TooManyChildClassesException;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Meritoo\Common\Test\Exception\Regex;
|
namespace Meritoo\Test\Common\Exception\Regex;
|
||||||
|
|
||||||
use Generator;
|
use Generator;
|
||||||
use Meritoo\Common\Exception\Regex\IncorrectColorHexLengthException;
|
use Meritoo\Common\Exception\Regex\IncorrectColorHexLengthException;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Meritoo\Common\Test\Exception\Regex;
|
namespace Meritoo\Test\Common\Exception\Regex;
|
||||||
|
|
||||||
use Generator;
|
use Generator;
|
||||||
use Meritoo\Common\Exception\Regex\InvalidColorHexValueException;
|
use Meritoo\Common\Exception\Regex\InvalidColorHexValueException;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Meritoo\Common\Test\Exception\Regex;
|
namespace Meritoo\Test\Common\Exception\Regex;
|
||||||
|
|
||||||
use Generator;
|
use Generator;
|
||||||
use Meritoo\Common\Exception\Regex\InvalidHtmlAttributesException;
|
use Meritoo\Common\Exception\Regex\InvalidHtmlAttributesException;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Meritoo\Common\Test\Exception\Regex;
|
namespace Meritoo\Test\Common\Exception\Regex;
|
||||||
|
|
||||||
use Generator;
|
use Generator;
|
||||||
use Meritoo\Common\Exception\Regex\InvalidUrlException;
|
use Meritoo\Common\Exception\Regex\InvalidUrlException;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Meritoo\Common\Test\Exception\Type;
|
namespace Meritoo\Test\Common\Exception\Type;
|
||||||
|
|
||||||
use Generator;
|
use Generator;
|
||||||
use Meritoo\Common\Exception\Type\UnknownOopVisibilityTypeException;
|
use Meritoo\Common\Exception\Type\UnknownOopVisibilityTypeException;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Meritoo\Common\Test\Test\Base;
|
namespace Meritoo\Test\Common\Test\Base;
|
||||||
|
|
||||||
use DateTime;
|
use DateTime;
|
||||||
use Generator;
|
use Generator;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Meritoo\Common\Test\Type\Base;
|
namespace Meritoo\Test\Common\Type\Base;
|
||||||
|
|
||||||
use Generator;
|
use Generator;
|
||||||
use Meritoo\Common\Test\Base\BaseTestCase;
|
use Meritoo\Common\Test\Base\BaseTestCase;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Meritoo\Common\Test\Type;
|
namespace Meritoo\Test\Common\Type;
|
||||||
|
|
||||||
use Meritoo\Common\Test\Base\BaseTypeTestCase;
|
use Meritoo\Common\Test\Base\BaseTypeTestCase;
|
||||||
use Meritoo\Common\Type\DatePartType;
|
use Meritoo\Common\Type\DatePartType;
|
||||||
@@ -19,29 +19,6 @@ use Meritoo\Common\Type\DatePartType;
|
|||||||
*/
|
*/
|
||||||
class DatePartTypeTest extends BaseTypeTestCase
|
class DatePartTypeTest extends BaseTypeTestCase
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* {@inheritdoc}
|
|
||||||
*/
|
|
||||||
protected function getAllExpectedTypes()
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
'DAY' => DatePartType::DAY,
|
|
||||||
'HOUR' => DatePartType::HOUR,
|
|
||||||
'MINUTE' => DatePartType::MINUTE,
|
|
||||||
'MONTH' => DatePartType::MONTH,
|
|
||||||
'SECOND' => DatePartType::SECOND,
|
|
||||||
'YEAR' => DatePartType::YEAR,
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritdoc}
|
|
||||||
*/
|
|
||||||
protected function getTestedTypeInstance()
|
|
||||||
{
|
|
||||||
return new DatePartType();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
@@ -97,4 +74,27 @@ class DatePartTypeTest extends BaseTypeTestCase
|
|||||||
true,
|
true,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
protected function getAllExpectedTypes()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'DAY' => DatePartType::DAY,
|
||||||
|
'HOUR' => DatePartType::HOUR,
|
||||||
|
'MINUTE' => DatePartType::MINUTE,
|
||||||
|
'MONTH' => DatePartType::MONTH,
|
||||||
|
'SECOND' => DatePartType::SECOND,
|
||||||
|
'YEAR' => DatePartType::YEAR,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
protected function getTestedTypeInstance()
|
||||||
|
{
|
||||||
|
return new DatePartType();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Meritoo\Common\Test\Type;
|
namespace Meritoo\Test\Common\Type;
|
||||||
|
|
||||||
use DateTime;
|
use DateTime;
|
||||||
use Generator;
|
use Generator;
|
||||||
@@ -214,34 +214,6 @@ class DatePeriodTest extends BaseTypeTestCase
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns all expected types of the tested type
|
|
||||||
*
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
protected function getAllExpectedTypes()
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
'LAST_MONTH' => DatePeriod::LAST_MONTH,
|
|
||||||
'LAST_WEEK' => DatePeriod::LAST_WEEK,
|
|
||||||
'LAST_YEAR' => DatePeriod::LAST_YEAR,
|
|
||||||
'NEXT_MONTH' => DatePeriod::NEXT_MONTH,
|
|
||||||
'NEXT_WEEK' => DatePeriod::NEXT_WEEK,
|
|
||||||
'NEXT_YEAR' => DatePeriod::NEXT_YEAR,
|
|
||||||
'THIS_MONTH' => DatePeriod::THIS_MONTH,
|
|
||||||
'THIS_WEEK' => DatePeriod::THIS_WEEK,
|
|
||||||
'THIS_YEAR' => DatePeriod::THIS_YEAR,
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritdoc}
|
|
||||||
*/
|
|
||||||
protected function getTestedTypeInstance()
|
|
||||||
{
|
|
||||||
return new DatePeriod();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
@@ -277,4 +249,32 @@ class DatePeriodTest extends BaseTypeTestCase
|
|||||||
true,
|
true,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns all expected types of the tested type
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
protected function getAllExpectedTypes()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'LAST_MONTH' => DatePeriod::LAST_MONTH,
|
||||||
|
'LAST_WEEK' => DatePeriod::LAST_WEEK,
|
||||||
|
'LAST_YEAR' => DatePeriod::LAST_YEAR,
|
||||||
|
'NEXT_MONTH' => DatePeriod::NEXT_MONTH,
|
||||||
|
'NEXT_WEEK' => DatePeriod::NEXT_WEEK,
|
||||||
|
'NEXT_YEAR' => DatePeriod::NEXT_YEAR,
|
||||||
|
'THIS_MONTH' => DatePeriod::THIS_MONTH,
|
||||||
|
'THIS_WEEK' => DatePeriod::THIS_WEEK,
|
||||||
|
'THIS_YEAR' => DatePeriod::THIS_YEAR,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
protected function getTestedTypeInstance()
|
||||||
|
{
|
||||||
|
return new DatePeriod();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Meritoo\Common\Test\Utilities\Arrays;
|
namespace Meritoo\Test\Common\Utilities\Arrays;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Simple class convertible to string.
|
* Simple class convertible to string.
|
||||||
|
|||||||
@@ -6,11 +6,11 @@
|
|||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Meritoo\Common\Test\Utilities;
|
namespace Meritoo\Test\Common\Utilities;
|
||||||
|
|
||||||
use Meritoo\Common\Test\Base\BaseTestCase;
|
use Meritoo\Common\Test\Base\BaseTestCase;
|
||||||
use Meritoo\Common\Test\Utilities\Arrays\SimpleToString;
|
|
||||||
use Meritoo\Common\Utilities\Arrays;
|
use Meritoo\Common\Utilities\Arrays;
|
||||||
|
use Meritoo\Test\Common\Utilities\Arrays\SimpleToString;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test case of the useful arrays methods
|
* Test case of the useful arrays methods
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Meritoo\Common\Test\Utilities;
|
namespace Meritoo\Test\Common\Utilities;
|
||||||
|
|
||||||
use Meritoo\Common\Test\Base\BaseTestCase;
|
use Meritoo\Common\Test\Base\BaseTestCase;
|
||||||
use Meritoo\Common\Utilities\Bootstrap4CssSelector;
|
use Meritoo\Common\Utilities\Bootstrap4CssSelector;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Meritoo\Common\Test\Utilities;
|
namespace Meritoo\Test\Common\Utilities;
|
||||||
|
|
||||||
use Generator;
|
use Generator;
|
||||||
use Meritoo\Common\Exception\Bundle\IncorrectBundleNameException;
|
use Meritoo\Common\Exception\Bundle\IncorrectBundleNameException;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Meritoo\Common\Test\Utilities;
|
namespace Meritoo\Test\Common\Utilities;
|
||||||
|
|
||||||
use Generator;
|
use Generator;
|
||||||
use Meritoo\Common\Test\Base\BaseTestCase;
|
use Meritoo\Common\Test\Base\BaseTestCase;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Meritoo\Common\Test\Utilities;
|
namespace Meritoo\Test\Common\Utilities;
|
||||||
|
|
||||||
use Meritoo\Common\Test\Base\BaseTestCase;
|
use Meritoo\Common\Test\Base\BaseTestCase;
|
||||||
use Meritoo\Common\Utilities\CssSelector;
|
use Meritoo\Common\Utilities\CssSelector;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Meritoo\Common\Test\Utilities;
|
namespace Meritoo\Test\Common\Utilities;
|
||||||
|
|
||||||
use DateInterval;
|
use DateInterval;
|
||||||
use DateTime;
|
use DateTime;
|
||||||
@@ -680,7 +680,8 @@ class DateTest extends BaseTestCase
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param int $period The period, type of period. One of DatePeriod class constants, e.g. DatePeriod::LAST_WEEK.
|
* @param int $period The period, type of period. One of DatePeriod class constants, e.g.
|
||||||
|
* DatePeriod::LAST_WEEK.
|
||||||
* @param DatePeriod $expected Expected start and end date for given period
|
* @param DatePeriod $expected Expected start and end date for given period
|
||||||
*
|
*
|
||||||
* @dataProvider provideCorrectPeriod
|
* @dataProvider provideCorrectPeriod
|
||||||
@@ -982,7 +983,9 @@ class DateTest extends BaseTestCase
|
|||||||
DatePeriod::NEXT_WEEK,
|
DatePeriod::NEXT_WEEK,
|
||||||
new DatePeriod(
|
new DatePeriod(
|
||||||
(new DateTime('this week'))->add(new DateInterval('P7D'))->setTime(0, 0, 0),
|
(new DateTime('this week'))->add(new DateInterval('P7D'))->setTime(0, 0, 0),
|
||||||
(new DateTime('this week'))->add(new DateInterval('P7D'))->add(new DateInterval('P6D'))->setTime(23, 59, 59)
|
(new DateTime('this week'))->add(new DateInterval('P7D'))
|
||||||
|
->add(new DateInterval('P6D'))
|
||||||
|
->setTime(23, 59, 59)
|
||||||
),
|
),
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Meritoo\Common\Test\Utilities;
|
namespace Meritoo\Test\Common\Utilities;
|
||||||
|
|
||||||
use Meritoo\Common\Test\Base\BaseTestCase;
|
use Meritoo\Common\Test\Base\BaseTestCase;
|
||||||
use Meritoo\Common\Utilities\GeneratorUtility;
|
use Meritoo\Common\Utilities\GeneratorUtility;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Meritoo\Common\Test\Utilities;
|
namespace Meritoo\Test\Common\Utilities;
|
||||||
|
|
||||||
use Generator;
|
use Generator;
|
||||||
use Meritoo\Common\Test\Base\BaseTestCase;
|
use Meritoo\Common\Test\Base\BaseTestCase;
|
||||||
@@ -80,8 +80,8 @@ class LocaleTest extends BaseTestCase
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param int $category Named constant specifying the category of the functions affected by the locale setting.
|
* @param int $category Named constant specifying the category of the functions affected by the locale
|
||||||
* It's the same constant as required by setlocale() function.
|
* setting. It's the same constant as required by setlocale() function.
|
||||||
* @param string $languageCode Language code, in ISO 639-1 format. Short form of the locale, e.g. "fr".
|
* @param string $languageCode Language code, in ISO 639-1 format. Short form of the locale, e.g. "fr".
|
||||||
* @param string $countryCode Country code, in ISO 3166-1 alpha-2 format, e.g. "FR"
|
* @param string $countryCode Country code, in ISO 3166-1 alpha-2 format, e.g. "FR"
|
||||||
* @param string $expectedLocale Expected locale
|
* @param string $expectedLocale Expected locale
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Meritoo\Common\Test\Utilities;
|
namespace Meritoo\Test\Common\Utilities;
|
||||||
|
|
||||||
use Generator;
|
use Generator;
|
||||||
use Meritoo\Common\Test\Base\BaseTestCase;
|
use Meritoo\Common\Test\Base\BaseTestCase;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Meritoo\Common\Test\Utilities;
|
namespace Meritoo\Test\Common\Utilities;
|
||||||
|
|
||||||
use Generator;
|
use Generator;
|
||||||
use Meritoo\Common\Exception\Regex\IncorrectColorHexLengthException;
|
use Meritoo\Common\Exception\Regex\IncorrectColorHexLengthException;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Meritoo\Common\Test\Utilities;
|
namespace Meritoo\Test\Common\Utilities;
|
||||||
|
|
||||||
use Doctrine\Common\Collections\ArrayCollection;
|
use Doctrine\Common\Collections\ArrayCollection;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManager;
|
||||||
@@ -260,7 +260,8 @@ class QueryBuilderUtilityTest extends BaseTestCase
|
|||||||
$entityManager
|
$entityManager
|
||||||
->expects(static::any())
|
->expects(static::any())
|
||||||
->method('getExpressionBuilder')
|
->method('getExpressionBuilder')
|
||||||
->willReturn(new Expr());
|
->willReturn(new Expr())
|
||||||
|
;
|
||||||
|
|
||||||
yield[
|
yield[
|
||||||
(new QueryBuilder($entityManager))->from('lorem_ipsum', 'lm'),
|
(new QueryBuilder($entityManager))->from('lorem_ipsum', 'lm'),
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Meritoo\Common\Test\Utilities\Reflection;
|
namespace Meritoo\Test\Common\Utilities\Reflection;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The A class.
|
* The A class.
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Meritoo\Common\Test\Utilities\Reflection;
|
namespace Meritoo\Test\Common\Utilities\Reflection;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The B class.
|
* The B class.
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Meritoo\Common\Test\Utilities\Reflection;
|
namespace Meritoo\Test\Common\Utilities\Reflection;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The C class.
|
* The C class.
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Meritoo\Common\Test\Utilities\Reflection;
|
namespace Meritoo\Test\Common\Utilities\Reflection;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The D class.
|
* The D class.
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Meritoo\Common\Test\Utilities\Reflection;
|
namespace Meritoo\Test\Common\Utilities\Reflection;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The E trait.
|
* The E trait.
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Meritoo\Common\Test\Utilities\Reflection;
|
namespace Meritoo\Test\Common\Utilities\Reflection;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The F class.
|
* The F class.
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Meritoo\Common\Test\Utilities\Reflection;
|
namespace Meritoo\Test\Common\Utilities\Reflection;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The G class.
|
* The G class.
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Meritoo\Common\Test\Utilities\Reflection;
|
namespace Meritoo\Test\Common\Utilities\Reflection;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The H class.
|
* The H class.
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Meritoo\Common\Test\Utilities\Reflection;
|
namespace Meritoo\Test\Common\Utilities\Reflection;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The H interface.
|
* The H interface.
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Meritoo\Common\Test\Utilities;
|
namespace Meritoo\Test\Common\Utilities;
|
||||||
|
|
||||||
use DateTime;
|
use DateTime;
|
||||||
use Generator;
|
use Generator;
|
||||||
@@ -16,16 +16,16 @@ use Meritoo\Common\Exception\Reflection\MissingChildClassesException;
|
|||||||
use Meritoo\Common\Exception\Reflection\NotExistingPropertyException;
|
use Meritoo\Common\Exception\Reflection\NotExistingPropertyException;
|
||||||
use Meritoo\Common\Exception\Reflection\TooManyChildClassesException;
|
use Meritoo\Common\Exception\Reflection\TooManyChildClassesException;
|
||||||
use Meritoo\Common\Test\Base\BaseTestCase;
|
use Meritoo\Common\Test\Base\BaseTestCase;
|
||||||
use Meritoo\Common\Test\Utilities\Reflection\A;
|
|
||||||
use Meritoo\Common\Test\Utilities\Reflection\B;
|
|
||||||
use Meritoo\Common\Test\Utilities\Reflection\C;
|
|
||||||
use Meritoo\Common\Test\Utilities\Reflection\D;
|
|
||||||
use Meritoo\Common\Test\Utilities\Reflection\E;
|
|
||||||
use Meritoo\Common\Test\Utilities\Reflection\F;
|
|
||||||
use Meritoo\Common\Test\Utilities\Reflection\G;
|
|
||||||
use Meritoo\Common\Test\Utilities\Reflection\H;
|
|
||||||
use Meritoo\Common\Test\Utilities\Reflection\I;
|
|
||||||
use Meritoo\Common\Utilities\Reflection;
|
use Meritoo\Common\Utilities\Reflection;
|
||||||
|
use Meritoo\Test\Common\Utilities\Reflection\A;
|
||||||
|
use Meritoo\Test\Common\Utilities\Reflection\B;
|
||||||
|
use Meritoo\Test\Common\Utilities\Reflection\C;
|
||||||
|
use Meritoo\Test\Common\Utilities\Reflection\D;
|
||||||
|
use Meritoo\Test\Common\Utilities\Reflection\E;
|
||||||
|
use Meritoo\Test\Common\Utilities\Reflection\F;
|
||||||
|
use Meritoo\Test\Common\Utilities\Reflection\G;
|
||||||
|
use Meritoo\Test\Common\Utilities\Reflection\H;
|
||||||
|
use Meritoo\Test\Common\Utilities\Reflection\I;
|
||||||
use ReflectionProperty;
|
use ReflectionProperty;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -107,7 +107,7 @@ class ReflectionTest extends BaseTestCase
|
|||||||
/*
|
/*
|
||||||
* Existing class
|
* Existing class
|
||||||
*/
|
*/
|
||||||
self::assertEquals('Meritoo\Common\Test\Utilities', Reflection::getClassNamespace(self::class));
|
self::assertEquals('Meritoo\Test\Common\Utilities', Reflection::getClassNamespace(self::class));
|
||||||
self::assertEquals(DateTime::class, Reflection::getClassNamespace(new DateTime()));
|
self::assertEquals(DateTime::class, Reflection::getClassNamespace(new DateTime()));
|
||||||
|
|
||||||
self::assertEquals(DateTime::class, Reflection::getClassNamespace([
|
self::assertEquals(DateTime::class, Reflection::getClassNamespace([
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Meritoo\Common\Test\Utilities\Repository;
|
namespace Meritoo\Test\Common\Utilities\Repository;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sortable object/entity.
|
* Sortable object/entity.
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Meritoo\Common\Test\Utilities;
|
namespace Meritoo\Test\Common\Utilities;
|
||||||
|
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Doctrine\ORM\EntityRepository;
|
use Doctrine\ORM\EntityRepository;
|
||||||
@@ -14,8 +14,8 @@ use Doctrine\ORM\Query\Expr\OrderBy;
|
|||||||
use Doctrine\ORM\QueryBuilder;
|
use Doctrine\ORM\QueryBuilder;
|
||||||
use Generator;
|
use Generator;
|
||||||
use Meritoo\Common\Test\Base\BaseTestCase;
|
use Meritoo\Common\Test\Base\BaseTestCase;
|
||||||
use Meritoo\Common\Test\Utilities\Repository\Sortable;
|
|
||||||
use Meritoo\Common\Utilities\Repository;
|
use Meritoo\Common\Utilities\Repository;
|
||||||
|
use Meritoo\Test\Common\Utilities\Repository\Sortable;
|
||||||
use stdClass;
|
use stdClass;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -220,7 +220,8 @@ class RepositoryTest extends BaseTestCase
|
|||||||
->setMethods([
|
->setMethods([
|
||||||
'createQueryBuilder',
|
'createQueryBuilder',
|
||||||
])
|
])
|
||||||
->getMock();
|
->getMock()
|
||||||
|
;
|
||||||
|
|
||||||
$expectedQueryBuilder = new QueryBuilder($entityManager);
|
$expectedQueryBuilder = new QueryBuilder($entityManager);
|
||||||
$expectedQueryBuilder->from('any_table_name', 'qb');
|
$expectedQueryBuilder->from('any_table_name', 'qb');
|
||||||
@@ -228,7 +229,8 @@ class RepositoryTest extends BaseTestCase
|
|||||||
$entityRepository
|
$entityRepository
|
||||||
->expects(static::once())
|
->expects(static::once())
|
||||||
->method('createQueryBuilder')
|
->method('createQueryBuilder')
|
||||||
->willReturn($expectedQueryBuilder);
|
->willReturn($expectedQueryBuilder)
|
||||||
|
;
|
||||||
|
|
||||||
$queryBuilder = Repository::getEntityOrderedQueryBuilder($entityRepository);
|
$queryBuilder = Repository::getEntityOrderedQueryBuilder($entityRepository);
|
||||||
$selectDQLPart = $queryBuilder->getDQLPart('select');
|
$selectDQLPart = $queryBuilder->getDQLPart('select');
|
||||||
@@ -262,7 +264,8 @@ class RepositoryTest extends BaseTestCase
|
|||||||
->setMethods([
|
->setMethods([
|
||||||
'createQueryBuilder',
|
'createQueryBuilder',
|
||||||
])
|
])
|
||||||
->getMock();
|
->getMock()
|
||||||
|
;
|
||||||
|
|
||||||
$expectedQueryBuilder = new QueryBuilder($entityManager);
|
$expectedQueryBuilder = new QueryBuilder($entityManager);
|
||||||
$expectedQueryBuilder->from('any_table_name', 'qb');
|
$expectedQueryBuilder->from('any_table_name', 'qb');
|
||||||
@@ -270,7 +273,8 @@ class RepositoryTest extends BaseTestCase
|
|||||||
$entityRepository
|
$entityRepository
|
||||||
->expects(static::once())
|
->expects(static::once())
|
||||||
->method('createQueryBuilder')
|
->method('createQueryBuilder')
|
||||||
->willReturn($expectedQueryBuilder);
|
->willReturn($expectedQueryBuilder)
|
||||||
|
;
|
||||||
|
|
||||||
$queryBuilder = Repository::getEntityOrderedQueryBuilder($entityRepository, $property, $direction);
|
$queryBuilder = Repository::getEntityOrderedQueryBuilder($entityRepository, $property, $direction);
|
||||||
$selectDQLPart = $queryBuilder->getDQLPart('select');
|
$selectDQLPart = $queryBuilder->getDQLPart('select');
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Meritoo\Common\Test\Utilities;
|
namespace Meritoo\Test\Common\Utilities;
|
||||||
|
|
||||||
use Generator;
|
use Generator;
|
||||||
use Meritoo\Common\Test\Base\BaseTestCase;
|
use Meritoo\Common\Test\Base\BaseTestCase;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Meritoo\Common\Test\Utilities;
|
namespace Meritoo\Test\Common\Utilities;
|
||||||
|
|
||||||
use Meritoo\Common\Test\Base\BaseTestCase;
|
use Meritoo\Common\Test\Base\BaseTestCase;
|
||||||
use Meritoo\Common\Utilities\Xml;
|
use Meritoo\Common\Utilities\Xml;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Meritoo\Common\Test\ValueObject;
|
namespace Meritoo\Test\Common\ValueObject;
|
||||||
|
|
||||||
use Meritoo\Common\Test\Base\BaseTestCase;
|
use Meritoo\Common\Test\Base\BaseTestCase;
|
||||||
use Meritoo\Common\Type\OopVisibilityType;
|
use Meritoo\Common\Type\OopVisibilityType;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Meritoo\Common\Test\ValueObject;
|
namespace Meritoo\Test\Common\ValueObject;
|
||||||
|
|
||||||
use Meritoo\Common\Test\Base\BaseTestCase;
|
use Meritoo\Common\Test\Base\BaseTestCase;
|
||||||
use Meritoo\Common\Type\OopVisibilityType;
|
use Meritoo\Common\Type\OopVisibilityType;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Meritoo\Common\Test\ValueObject;
|
namespace Meritoo\Test\Common\ValueObject;
|
||||||
|
|
||||||
use Meritoo\Common\Test\Base\BaseTestCase;
|
use Meritoo\Common\Test\Base\BaseTestCase;
|
||||||
use Meritoo\Common\Type\OopVisibilityType;
|
use Meritoo\Common\Type\OopVisibilityType;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Meritoo\Common\Test\ValueObject;
|
namespace Meritoo\Test\Common\ValueObject;
|
||||||
|
|
||||||
use Meritoo\Common\Test\Base\BaseTestCase;
|
use Meritoo\Common\Test\Base\BaseTestCase;
|
||||||
use Meritoo\Common\Type\OopVisibilityType;
|
use Meritoo\Common\Type\OopVisibilityType;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Meritoo\Common\Test\ValueObject;
|
namespace Meritoo\Test\Common\ValueObject;
|
||||||
|
|
||||||
use Generator;
|
use Generator;
|
||||||
use Meritoo\Common\Test\Base\BaseTestCase;
|
use Meritoo\Common\Test\Base\BaseTestCase;
|
||||||
|
|||||||
Reference in New Issue
Block a user