Apply fixes from StyleCI

This commit is contained in:
meritoo
2017-09-20 08:29:52 +00:00
committed by StyleCI Bot
parent 94a464cb4d
commit b9dfa713ff
47 changed files with 1430 additions and 1220 deletions

View File

@@ -14,7 +14,7 @@ use Meritoo\Common\Test\Base\BaseTestCase;
use Meritoo\Common\Type\OopVisibilityType;
/**
* Tests of the collection of elements
* Tests of the collection of elements.
*
* @author Krzysztof Niziol <krzysztof.niziol@meritoo.pl>
* @copyright Meritoo.pl
@@ -22,21 +22,21 @@ use Meritoo\Common\Type\OopVisibilityType;
class CollectionTest extends BaseTestCase
{
/**
* An empty collection
* An empty collection.
*
* @var Collection
*/
private $emptyCollection;
/**
* Simple collection
* Simple collection.
*
* @var Collection
*/
private $simpleCollection;
/**
* Elements of simple collection
* Elements of simple collection.
*
* @var array
*/

View File

@@ -13,7 +13,7 @@ use Meritoo\Common\Type\Base\BaseType;
use PHPUnit_Framework_TestCase;
/**
* Tests of the exception used while type of something is unknown
* Tests of the exception used while type of something is unknown.
*
* @author Krzysztof Niziol <krzysztof.niziol@meritoo.pl>
* @copyright Meritoo.pl
@@ -33,7 +33,7 @@ class UnknownTypeExceptionTest extends PHPUnit_Framework_TestCase
}
/**
* Type of something (for testing purposes)
* Type of something (for testing purposes).
*
* @author Krzysztof Niziol <krzysztof.niziol@meritoo.pl>
* @copyright Meritoo.pl
@@ -46,7 +46,7 @@ class TestType extends BaseType
}
/**
* An exception used while type of something is unknown (for testing purposes)
* An exception used while type of something is unknown (for testing purposes).
*
* @author Krzysztof Niziol <krzysztof.niziol@meritoo.pl>
* @copyright Meritoo.pl
@@ -54,7 +54,7 @@ class TestType extends BaseType
class UnknownTestTypeException extends UnknownTypeException
{
/**
* Class constructor
* Class constructor.
*
* @param int|string $unknownType The unknown type of something (for testing purposes)
*/
@@ -65,7 +65,7 @@ class UnknownTestTypeException extends UnknownTypeException
}
/**
* Service used together with type of something (for testing purposes)
* Service used together with type of something (for testing purposes).
*
* @author Krzysztof Niziol <krzysztof.niziol@meritoo.pl>
* @copyright Meritoo.pl
@@ -73,9 +73,10 @@ class UnknownTestTypeException extends UnknownTypeException
class TestService
{
/**
* Returns translated type (for testing purposes)
* Returns translated type (for testing purposes).
*
* @param string $type Type of something (for testing purposes)
*
* @return string
*
* @throws UnknownTestTypeException

View File

@@ -13,7 +13,7 @@ use Meritoo\Common\Type\Base\BaseType;
use PHPUnit_Framework_TestCase;
/**
* Tests of the base / abstract type of something
* Tests of the base / abstract type of something.
*
* @author Krzysztof Niziol <krzysztof.niziol@meritoo.pl>
* @copyright Meritoo.pl
@@ -45,7 +45,7 @@ class BaseTypeTest extends PHPUnit_Framework_TestCase
}
/**
* Provides type of something for testing the getAll() method
* Provides type of something for testing the getAll() method.
*
* @return Generator
*/
@@ -66,7 +66,7 @@ class BaseTypeTest extends PHPUnit_Framework_TestCase
}
/**
* Provides type of something for testing the isCorrectType() method
* Provides type of something for testing the isCorrectType() method.
*
* @return Generator
*/
@@ -177,7 +177,7 @@ class BaseTypeTest extends PHPUnit_Framework_TestCase
}
/**
* Empty type of something used for testing
* Empty type of something used for testing.
*
* @author Krzysztof Niziol <krzysztof.niziol@meritoo.pl>
* @copyright Meritoo.pl
@@ -187,7 +187,7 @@ class TestEmptyType extends BaseType
}
/**
* Type of something used for testing
* Type of something used for testing.
*
* @author Krzysztof Niziol <krzysztof.niziol@meritoo.pl>
* @copyright Meritoo.pl

View File

@@ -12,7 +12,7 @@ use Meritoo\Common\Test\Base\BaseTypeTestCase;
use Meritoo\Common\Type\DatePartType;
/**
* Tests of the type of date part, e.g. "year"
* Tests of the type of date part, e.g. "year".
*
* @author Krzysztof Niziol <krzysztof.niziol@meritoo.pl>
* @copyright Meritoo.pl
@@ -25,12 +25,12 @@ class DatePartTypeTest extends BaseTypeTestCase
protected function getAllExpectedTypes()
{
return [
'DAY' => DatePartType::DAY,
'HOUR' => DatePartType::HOUR,
'DAY' => DatePartType::DAY,
'HOUR' => DatePartType::HOUR,
'MINUTE' => DatePartType::MINUTE,
'MONTH' => DatePartType::MONTH,
'MONTH' => DatePartType::MONTH,
'SECOND' => DatePartType::SECOND,
'YEAR' => DatePartType::YEAR,
'YEAR' => DatePartType::YEAR,
];
}

View File

@@ -12,7 +12,7 @@ use Meritoo\Common\Utilities\Arrays;
use PHPUnit_Framework_TestCase;
/**
* Tests of the useful arrays methods
* Tests of the useful arrays methods.
*
* @author Krzysztof Niziol <krzysztof.niziol@meritoo.pl>
* @copyright Meritoo.pl
@@ -67,8 +67,8 @@ class ArraysTest extends PHPUnit_Framework_TestCase
self::assertEquals('', Arrays::values2csv($this->simpleArray));
self::assertEquals("lorem,ipsum,dolor,sit,amet\n"
. "consectetur,adipiscing,elit\n"
. 'donec,sagittis,fringilla,eleifend', Arrays::values2csv($this->twoDimensionsArray));
."consectetur,adipiscing,elit\n"
.'donec,sagittis,fringilla,eleifend', Arrays::values2csv($this->twoDimensionsArray));
}
public function testGetFirstKey()
@@ -175,7 +175,7 @@ class ArraysTest extends PHPUnit_Framework_TestCase
{
$effect = [
'nullam' => 'donec',
'x' => [
'x' => [
'vitae' => [
'x' => 'quis',
],
@@ -188,7 +188,7 @@ class ArraysTest extends PHPUnit_Framework_TestCase
self::assertEquals([
'x' => 'sit',
4 => 'amet',
4 => 'amet',
], Arrays::replaceArrayKeys($this->simpleArray, '|[0-3]+|', 'x'));
}
@@ -370,19 +370,19 @@ letsTest[2] = value_2;';
'lorem' => 0,
'ipsum' => 1,
'dolor' => 2,
'sit' => 3,
'amet' => 4,
'sit' => 3,
'amet' => 4,
],
[
'consectetur' => 0,
'adipiscing' => 1,
'elit' => 2,
'adipiscing' => 1,
'elit' => 2,
],
[
'donec' => 0,
'sagittis' => 1,
'donec' => 0,
'sagittis' => 1,
'fringilla' => 2,
'eleifend' => 3,
'eleifend' => 3,
],
];
@@ -428,16 +428,16 @@ letsTest[2] = value_2;';
*/
$array = [
'light' => '#fff',
'dark' => '#000',
'dark' => '#000',
];
self::assertEquals($array, Arrays::string2array('light:#fff|dark:#000'));
self::assertEquals($array, Arrays::string2array('light: #fff | dark: #000'));
$array = [
'red' => '#f00',
'red' => '#f00',
'green' => '#0f0',
'blue' => '#00f',
'blue' => '#00f',
];
self::assertEquals($array, Arrays::string2array('red:#f00|green:#0f0|blue:#00f'));
@@ -489,12 +489,12 @@ letsTest[2] = value_2;';
$keys16 = [
'a' => 'lorem',
11 => 'amet',
11 => 'amet',
];
$keys17 = [
'a' => 'lorem',
11 => 'amet',
11 => 'amet',
'c' => 'sit__',
];
@@ -518,16 +518,16 @@ letsTest[2] = value_2;';
* Using default separator and other default arguments
*/
$expected = [
'lorem.ipsum.dolor' => 'sit',
'lorem.ipsum.diam.non' => 'egestas',
'consectetur' => 'adipiscing',
'mollis' => 1234,
2 => [],
'sit.nullam' => 'donec',
'lorem.ipsum.dolor' => 'sit',
'lorem.ipsum.diam.non' => 'egestas',
'consectetur' => 'adipiscing',
'mollis' => 1234,
2 => [],
'sit.nullam' => 'donec',
'sit.aliquet.vitae.ligula' => 'quis',
'sit.0' => 'elit',
'amet.0' => 'iaculis',
'amet.1' => 'primis',
'sit.0' => 'elit',
'amet.0' => 'iaculis',
'amet.1' => 'primis',
];
self::assertEquals($expected, Arrays::getLastElementsPaths($this->complexArray));
@@ -537,16 +537,16 @@ letsTest[2] = value_2;';
*/
$separator = ' -> ';
$expected = [
sprintf('lorem%sipsum%sdolor', $separator, $separator) => 'sit',
sprintf('lorem%sipsum%sdiam%snon', $separator, $separator, $separator) => 'egestas',
'consectetur' => 'adipiscing',
'mollis' => 1234,
2 => [],
sprintf('sit%snullam', $separator) => 'donec',
sprintf('lorem%sipsum%sdolor', $separator, $separator) => 'sit',
sprintf('lorem%sipsum%sdiam%snon', $separator, $separator, $separator) => 'egestas',
'consectetur' => 'adipiscing',
'mollis' => 1234,
2 => [],
sprintf('sit%snullam', $separator) => 'donec',
sprintf('sit%saliquet%svitae%sligula', $separator, $separator, $separator) => 'quis',
sprintf('sit%s0', $separator) => 'elit',
sprintf('amet%s0', $separator) => 'iaculis',
sprintf('amet%s1', $separator) => 'primis',
sprintf('sit%s0', $separator) => 'elit',
sprintf('amet%s0', $separator) => 'iaculis',
sprintf('amet%s1', $separator) => 'primis',
];
self::assertEquals($expected, Arrays::getLastElementsPaths($this->complexArray, $separator));
@@ -555,16 +555,16 @@ letsTest[2] = value_2;';
* Special exception: do not use, stop recursive on the "diam" key
*/
$expected = [
'lorem.ipsum.dolor' => 'sit',
'consectetur' => 'adipiscing',
'mollis' => 1234,
2 => [],
'sit.nullam' => 'donec',
'lorem.ipsum.dolor' => 'sit',
'consectetur' => 'adipiscing',
'mollis' => 1234,
2 => [],
'sit.nullam' => 'donec',
'sit.aliquet.vitae.ligula' => 'quis',
'sit.0' => 'elit',
'amet.0' => 'iaculis',
'amet.1' => 'primis',
'lorem.ipsum.diam' => [
'sit.0' => 'elit',
'amet.0' => 'iaculis',
'amet.1' => 'primis',
'lorem.ipsum.diam' => [
'non' => 'egestas',
],
];
@@ -579,17 +579,17 @@ letsTest[2] = value_2;';
*/
$expected = [
'lorem . ipsum . dolor' => 'sit',
'consectetur' => 'adipiscing',
'mollis' => 1234,
2 => [],
'sit . nullam' => 'donec',
'sit . 0' => 'elit',
'amet . 0' => 'iaculis',
'amet . 1' => 'primis',
'lorem . ipsum . diam' => [
'consectetur' => 'adipiscing',
'mollis' => 1234,
2 => [],
'sit . nullam' => 'donec',
'sit . 0' => 'elit',
'amet . 0' => 'iaculis',
'amet . 1' => 'primis',
'lorem . ipsum . diam' => [
'non' => 'egestas',
],
'sit . aliquet' => [
'sit . aliquet' => [
'vitae' => [
'ligula' => 'quis',
],
@@ -623,12 +623,12 @@ letsTest[2] = value_2;';
2,
3,
],
'primis > 0' => [
'primis > 0' => [
'in',
'faucibus',
'orci',
],
'primis > 1' => [
'primis > 1' => [
'luctus',
'et',
'ultrices',
@@ -653,14 +653,14 @@ letsTest[2] = value_2;';
*/
$expected = [
'lorem > ipsum > dolor' => 'sit',
'consectetur' => 'adipiscing',
'mollis' => 1234,
2 => [],
'sit > nullam' => 'donec',
'sit > 0' => 'elit',
'amet > 0' => 'iaculis',
'amet > 1' => 'primis',
'lorem > ipsum > diam' => [
'consectetur' => 'adipiscing',
'mollis' => 1234,
2 => [],
'sit > nullam' => 'donec',
'sit > 0' => 'elit',
'amet > 0' => 'iaculis',
'amet > 1' => 'primis',
'lorem > ipsum > diam' => [
'non' => 'egestas',
],
'sit > aliquet > vitae' => [
@@ -679,7 +679,7 @@ letsTest[2] = value_2;';
* Stop building of paths on these paths (verify paths only)
*/
$expected = [
'ipsum > quis > vestibulum > porta-1' => [
'ipsum > quis > vestibulum > porta-1' => [
'turpis',
'urna',
],
@@ -691,13 +691,13 @@ letsTest[2] = value_2;';
],
],
],
'ipsum > quis > vestibulum > porta-3 > 0' => 1,
'ipsum > quis > vestibulum > porta-3 > 1' => 2,
'ipsum > quis > vestibulum > porta-3 > 2' => 3,
'primis > 0 > 0' => 'in',
'primis > 0 > 1' => 'faucibus',
'primis > 0 > 2' => 'orci',
'primis > 1' => [
'ipsum > quis > vestibulum > porta-3 > 0' => 1,
'ipsum > quis > vestibulum > porta-3 > 1' => 2,
'ipsum > quis > vestibulum > porta-3 > 2' => 3,
'primis > 0 > 0' => 'in',
'primis > 0 > 1' => 'faucibus',
'primis > 0 > 2' => 'orci',
'primis > 1' => [
'luctus',
'et',
'ultrices',
@@ -716,7 +716,7 @@ letsTest[2] = value_2;';
* Stop building of paths if path contains any of these part (verify part of paths only)
*/
$expected = [
'ipsum > quis > vestibulum > porta-1' => [
'ipsum > quis > vestibulum > porta-1' => [
'turpis',
'urna',
],
@@ -726,15 +726,15 @@ letsTest[2] = value_2;';
'aliquam',
],
],
'ipsum > quis > vestibulum > porta-3 > 0' => 1,
'ipsum > quis > vestibulum > porta-3 > 1' => 2,
'ipsum > quis > vestibulum > porta-3 > 2' => 3,
'primis > 0' => [
'ipsum > quis > vestibulum > porta-3 > 0' => 1,
'ipsum > quis > vestibulum > porta-3 > 1' => 2,
'ipsum > quis > vestibulum > porta-3 > 2' => 3,
'primis > 0' => [
'in',
'faucibus',
'orci',
],
'primis > 1' => [
'primis > 1' => [
'luctus',
'et',
'ultrices',
@@ -830,7 +830,7 @@ letsTest[2] = value_2;';
];
$existingKeys = [
'simpleArray' => [
'simpleArray' => [
1,
3,
4,
@@ -839,11 +839,11 @@ letsTest[2] = value_2;';
'dolor',
'amet',
],
'twoDimensionsArray' => [
'twoDimensionsArray' => [
2,
3,
],
'complexArray' => [
'complexArray' => [
'sit',
'aliquet',
'vitae',
@@ -883,7 +883,7 @@ letsTest[2] = value_2;';
2,
2,
],
'complexArray' => [
'complexArray' => [
[
'lorem',
'ipsum',
@@ -989,22 +989,22 @@ letsTest[2] = value_2;';
* Positive case - multi-dimensions array
*/
$effect = [
'amet' => [
'amet' => [
'iaculis',
'primis',
],
'consectetur' => 'adipiscing',
'lorem' => [
'lorem' => [
'ipsum' => [
'dolor' => 'sit',
'diam' => [
'diam' => [
'non' => 'egestas',
],
],
],
'mollis' => 1234,
'sit' => [
'nullam' => 'donec',
'mollis' => 1234,
'sit' => [
'nullam' => 'donec',
'aliquet' => [
'vitae' => [
'ligula' => 'quis',
@@ -1012,7 +1012,7 @@ letsTest[2] = value_2;';
],
'elit',
],
2 => [],
2 => [],
];
self::assertEquals($effect, Arrays::ksortRecursive($this->complexArray));
@@ -1021,23 +1021,23 @@ letsTest[2] = value_2;';
* Positive case - multi-dimensions array - with options of ksort() function
*/
$effect = [
2 => [],
'amet' => [
2 => [],
'amet' => [
'iaculis',
'primis',
],
'consectetur' => 'adipiscing',
'lorem' => [
'lorem' => [
'ipsum' => [
'dolor' => 'sit',
'diam' => [
'diam' => [
'non' => 'egestas',
],
],
],
'mollis' => 1234,
'sit' => [
'nullam' => 'donec',
'mollis' => 1234,
'sit' => [
'nullam' => 'donec',
'aliquet' => [
'vitae' => [
'ligula' => 'quis',
@@ -1086,7 +1086,7 @@ letsTest[2] = value_2;';
'dolor',
'sit',
],
'amet' => [
'amet' => [
'consectetur',
'adipiscing' => [
'elit' => [
@@ -1105,10 +1105,10 @@ letsTest[2] = value_2;';
'sit',
Arrays::POSITION_KEY_NAME => 1,
],
'amet' => [
'amet' => [
'consectetur',
'adipiscing' => [
'elit' => [
'adipiscing' => [
'elit' => [
'cras',
'quis',
'ligula',
@@ -1233,7 +1233,7 @@ letsTest[2] = value_2;';
$sorted = [
'dolor' => 'sit',
'amet' => 'consectetur',
'amet' => 'consectetur',
'Lorem' => 'ipsum',
];
@@ -1306,9 +1306,9 @@ letsTest[2] = value_2;';
* An array with elements that contain separator
*/
$array = [
'lorem' . $separator,
'lorem'.$separator,
'ipsum',
$separator . 'dolor',
$separator.'dolor',
];
self::assertEquals(implode($separator, [
@@ -1658,7 +1658,7 @@ letsTest[2] = value_2;';
}
/**
* Provides simple array to set/replace values with keys
* Provides simple array to set/replace values with keys.
*
* @return \Generator
*/
@@ -1691,14 +1691,14 @@ letsTest[2] = value_2;';
'Lorem' => 0,
'ipsum' => 1,
'dolor' => 2,
'sit' => 3,
'amet' => 4,
'sit' => 3,
'amet' => 4,
],
];
}
/**
* Provides an array with duplicated values to set/replace values with keys
* Provides an array with duplicated values to set/replace values with keys.
*
* @return \Generator
*/
@@ -1708,18 +1708,18 @@ letsTest[2] = value_2;';
[
'lorem' => 'ipsum',
'dolor' => 'ipsum',
'sit' => 'amet',
'diam' => 'non',
'elit' => 'non',
'in' => 'non',
'sit' => 'amet',
'diam' => 'non',
'elit' => 'non',
'in' => 'non',
],
[
'ipsum' => [
'lorem',
'dolor',
],
'amet' => 'sit',
'non' => [
'amet' => 'sit',
'non' => [
'diam',
'elit',
'in',
@@ -1729,14 +1729,14 @@ letsTest[2] = value_2;';
yield[
[
'lorem' => [
'lorem' => [
'diam' => 'non',
'elit' => 'non',
'in' => 'non',
'in' => 'non',
],
'dolor1' => 'ipsum',
'dolor2' => 'ipsum',
'sit' => 'amet',
'sit' => 'amet',
],
[
'lorem' => [
@@ -1750,7 +1750,7 @@ letsTest[2] = value_2;';
'dolor1',
'dolor2',
],
'amet' => 'sit',
'amet' => 'sit',
],
];
}
@@ -1773,7 +1773,7 @@ letsTest[2] = value_2;';
$this->simpleArrayWithKeys = [
'Lorem' => 'ipsum',
'dolor' => 'sit',
'amet' => 'consectetur',
'amet' => 'consectetur',
];
$this->twoDimensionsArray = [
@@ -1798,19 +1798,19 @@ letsTest[2] = value_2;';
];
$this->complexArray = [
'lorem' => [
'lorem' => [
'ipsum' => [
'dolor' => 'sit',
'diam' => [
'diam' => [
'non' => 'egestas',
],
],
],
'consectetur' => 'adipiscing',
'mollis' => 1234,
2 => [],
'sit' => [
'nullam' => 'donec',
'mollis' => 1234,
2 => [],
'sit' => [
'nullam' => 'donec',
'aliquet' => [
'vitae' => [
'ligula' => 'quis',
@@ -1818,14 +1818,14 @@ letsTest[2] = value_2;';
],
'elit',
],
'amet' => [
'amet' => [
'iaculis',
'primis',
],
];
$this->superComplexArray = [
'ipsum' => [
'ipsum' => [
'quis' => [
'vestibulum' => [
'porta-1' => [

View File

@@ -12,7 +12,7 @@ use Meritoo\Common\Utilities\Bundle;
use PHPUnit_Framework_TestCase;
/**
* Tests of the useful methods for bundle
* Tests of the useful methods for bundle.
*
* @author Krzysztof Niziol <krzysztof.niziol@meritoo.pl>
* @copyright Meritoo.pl

View File

@@ -13,7 +13,7 @@ use Meritoo\Common\Test\Base\BaseTestCase;
use Meritoo\Common\Utilities\Composer;
/**
* Tests of the useful Composer-related methods
* Tests of the useful Composer-related methods.
*
* @author Krzysztof Niziol <krzysztof.niziol@meritoo.pl>
* @copyright Meritoo.pl
@@ -21,7 +21,7 @@ use Meritoo\Common\Utilities\Composer;
class ComposerTest extends BaseTestCase
{
/**
* Path of existing composer.json used as source of data for tests
* Path of existing composer.json used as source of data for tests.
*
* @var string
*/
@@ -59,7 +59,7 @@ class ComposerTest extends BaseTestCase
}
/**
* Provides names and values of existing nodes
* Provides names and values of existing nodes.
*
* @return Generator
*/

View File

@@ -15,7 +15,7 @@ use Meritoo\Common\Type\OopVisibilityType;
use Meritoo\Common\Utilities\DatePeriod;
/**
* Tests of date's period
* Tests of date's period.
*
* @author Krzysztof Niziol <krzysztof.niziol@meritoo.pl>
* @copyright Meritoo.pl
@@ -110,7 +110,7 @@ class DatePeriodTest extends BaseTestCase
}
/**
* Provides the start and end date of date period
* Provides the start and end date of date period.
*
* @return Generator
*/
@@ -143,7 +143,7 @@ class DatePeriodTest extends BaseTestCase
}
/**
* Provides incorrect period
* Provides incorrect period.
*
* @return Generator
*/
@@ -155,7 +155,7 @@ class DatePeriodTest extends BaseTestCase
}
/**
* Provides period to verify
* Provides period to verify.
*
* @return Generator
*/
@@ -173,7 +173,7 @@ class DatePeriodTest extends BaseTestCase
}
/**
* Provides period and incorrect format of date to verify
* Provides period and incorrect format of date to verify.
*
* @return Generator
*/
@@ -199,7 +199,7 @@ class DatePeriodTest extends BaseTestCase
}
/**
* Provides period and format of date to verify
* Provides period and format of date to verify.
*
* @return Generator
*/

View File

@@ -16,7 +16,7 @@ use Meritoo\Common\Test\Base\BaseTestCase;
use Meritoo\Common\Utilities\Date;
/**
* Tests of the Date methods (only static functions)
* Tests of the Date methods (only static functions).
*
* @author Krzysztof Niziol <krzysztof.niziol@meritoo.pl>
* @copyright Meritoo.pl
@@ -189,7 +189,7 @@ class DateTest extends BaseTestCase
public function testGetCurrentDayOfWeek()
{
self::assertRegExp('/^[0-6]{1}$/', (string)Date::getCurrentDayOfWeek());
self::assertRegExp('/^[0-6]{1}$/', (string) Date::getCurrentDayOfWeek());
}
public function testGetCurrentDayOfWeekName()
@@ -231,7 +231,7 @@ class DateTest extends BaseTestCase
*/
public function testGetDayOfWeek($year, $month, $day)
{
self::assertRegExp('/^[0-6]{1}$/', (string)Date::getDayOfWeek($year, $month, $day));
self::assertRegExp('/^[0-6]{1}$/', (string) Date::getDayOfWeek($year, $month, $day));
}
/**
@@ -260,10 +260,10 @@ class DateTest extends BaseTestCase
$dateEnd = '2017-01-02';
$effect = [
Date::DATE_DIFFERENCE_UNIT_YEARS => 0,
Date::DATE_DIFFERENCE_UNIT_MONTHS => 0,
Date::DATE_DIFFERENCE_UNIT_DAYS => 1,
Date::DATE_DIFFERENCE_UNIT_HOURS => 0,
Date::DATE_DIFFERENCE_UNIT_YEARS => 0,
Date::DATE_DIFFERENCE_UNIT_MONTHS => 0,
Date::DATE_DIFFERENCE_UNIT_DAYS => 1,
Date::DATE_DIFFERENCE_UNIT_HOURS => 0,
Date::DATE_DIFFERENCE_UNIT_MINUTES => 0,
];
@@ -280,10 +280,10 @@ class DateTest extends BaseTestCase
* Difference of 1 day (using the relative date format)
*/
$effect = [
Date::DATE_DIFFERENCE_UNIT_YEARS => 0,
Date::DATE_DIFFERENCE_UNIT_MONTHS => 0,
Date::DATE_DIFFERENCE_UNIT_DAYS => 1,
Date::DATE_DIFFERENCE_UNIT_HOURS => 0,
Date::DATE_DIFFERENCE_UNIT_YEARS => 0,
Date::DATE_DIFFERENCE_UNIT_MONTHS => 0,
Date::DATE_DIFFERENCE_UNIT_DAYS => 1,
Date::DATE_DIFFERENCE_UNIT_HOURS => 0,
Date::DATE_DIFFERENCE_UNIT_MINUTES => 0,
];
@@ -301,10 +301,10 @@ class DateTest extends BaseTestCase
$dateEnd = '2017-01-02 14:15';
$effect = [
Date::DATE_DIFFERENCE_UNIT_YEARS => 0,
Date::DATE_DIFFERENCE_UNIT_MONTHS => 0,
Date::DATE_DIFFERENCE_UNIT_DAYS => 1,
Date::DATE_DIFFERENCE_UNIT_HOURS => 2,
Date::DATE_DIFFERENCE_UNIT_YEARS => 0,
Date::DATE_DIFFERENCE_UNIT_MONTHS => 0,
Date::DATE_DIFFERENCE_UNIT_DAYS => 1,
Date::DATE_DIFFERENCE_UNIT_HOURS => 2,
Date::DATE_DIFFERENCE_UNIT_MINUTES => 15,
];
@@ -330,10 +330,10 @@ class DateTest extends BaseTestCase
$dateEnd = '2017-02-11 16:30';
$effect = [
Date::DATE_DIFFERENCE_UNIT_YEARS => 0,
Date::DATE_DIFFERENCE_UNIT_MONTHS => 1,
Date::DATE_DIFFERENCE_UNIT_DAYS => 41,
Date::DATE_DIFFERENCE_UNIT_HOURS => 4,
Date::DATE_DIFFERENCE_UNIT_YEARS => 0,
Date::DATE_DIFFERENCE_UNIT_MONTHS => 1,
Date::DATE_DIFFERENCE_UNIT_DAYS => 41,
Date::DATE_DIFFERENCE_UNIT_HOURS => 4,
Date::DATE_DIFFERENCE_UNIT_MINUTES => 30,
];
@@ -362,10 +362,10 @@ class DateTest extends BaseTestCase
$dateEnd = $dateStart;
$effect = [
Date::DATE_DIFFERENCE_UNIT_YEARS => 0,
Date::DATE_DIFFERENCE_UNIT_MONTHS => 0,
Date::DATE_DIFFERENCE_UNIT_DAYS => 0,
Date::DATE_DIFFERENCE_UNIT_HOURS => 0,
Date::DATE_DIFFERENCE_UNIT_YEARS => 0,
Date::DATE_DIFFERENCE_UNIT_MONTHS => 0,
Date::DATE_DIFFERENCE_UNIT_DAYS => 0,
Date::DATE_DIFFERENCE_UNIT_HOURS => 0,
Date::DATE_DIFFERENCE_UNIT_MINUTES => 0,
];
@@ -502,7 +502,7 @@ class DateTest extends BaseTestCase
}
/**
* Provides incorrect invalidCount of DateTime
* Provides incorrect invalidCount of DateTime.
*
* @return Generator
*/
@@ -552,7 +552,7 @@ class DateTest extends BaseTestCase
}
/**
* Provides invalid format of date
* Provides invalid format of date.
*
* @return Generator
*/
@@ -570,7 +570,7 @@ class DateTest extends BaseTestCase
}
/**
* Provide empty dates for date difference
* Provide empty dates for date difference.
*
* @return Generator
*/
@@ -598,7 +598,7 @@ class DateTest extends BaseTestCase
}
/**
* Provides incorrect values of year, month and day
* Provides incorrect values of year, month and day.
*
* @return Generator
*/
@@ -648,7 +648,7 @@ class DateTest extends BaseTestCase
}
/**
* Provides values of year, month and day
* Provides values of year, month and day.
*
* @return Generator
*/
@@ -698,7 +698,7 @@ class DateTest extends BaseTestCase
}
/**
* Provides data for the random date with incorrect end of random partition
* Provides data for the random date with incorrect end of random partition.
*
* @return Generator
*/
@@ -712,7 +712,7 @@ class DateTest extends BaseTestCase
}
/**
* Provides data for the random date
* Provides data for the random date.
*
* @return Generator
*/

View File

@@ -12,7 +12,7 @@ use Meritoo\Common\Test\Base\BaseTestCase;
use Meritoo\Common\Utilities\GeneratorUtility;
/**
* Tests of the useful methods for the Generator class
* Tests of the useful methods for the Generator class.
*
* @author Krzysztof Niziol <krzysztof.niziol@meritoo.pl>
* @copyright Meritoo.pl

View File

@@ -13,7 +13,7 @@ use Meritoo\Common\Test\Base\BaseTestCase;
use Meritoo\Common\Utilities\Locale;
/**
* Tests of the useful locale methods
* Tests of the useful locale methods.
*
* @author Krzysztof Niziol <krzysztof.niziol@meritoo.pl>
* @copyright Meritoo.pl
@@ -64,7 +64,7 @@ class LocaleTest extends BaseTestCase
}
/**
* Provides language and country code
* Provides language and country code.
*
* @return Generator
*/
@@ -100,7 +100,7 @@ class LocaleTest extends BaseTestCase
}
/**
* Provides category and language
* Provides category and language.
*
* @return Generator
*/

View File

@@ -13,7 +13,7 @@ use Meritoo\Common\Test\Base\BaseTestCase;
use Meritoo\Common\Utilities\MimeTypes;
/**
* Tests of the useful methods for mime types of files
* Tests of the useful methods for mime types of files.
*
* @author Krzysztof Niziol <krzysztof.niziol@meritoo.pl>
* @copyright Meritoo.pl
@@ -186,7 +186,7 @@ class MimeTypesTest extends BaseTestCase
}
/**
* Provides not existing mime type
* Provides not existing mime type.
*
* @return Generator
*/
@@ -198,7 +198,7 @@ class MimeTypesTest extends BaseTestCase
}
/**
* Provides mime type of non-image
* Provides mime type of non-image.
*
* @return Generator
*/
@@ -211,7 +211,7 @@ class MimeTypesTest extends BaseTestCase
}
/**
* Provides mime type of image
* Provides mime type of image.
*
* @return Generator
*/
@@ -226,7 +226,7 @@ class MimeTypesTest extends BaseTestCase
}
/**
* Provides existing mime type used to get single, one extension
* Provides existing mime type used to get single, one extension.
*
* @return Generator
*/
@@ -249,7 +249,7 @@ class MimeTypesTest extends BaseTestCase
}
/**
* Provides existing mime type used to get multiple, more than one extension
* Provides existing mime type used to get multiple, more than one extension.
*
* @return Generator
*/
@@ -316,7 +316,7 @@ class MimeTypesTest extends BaseTestCase
}
/**
* Provides not existing mime types
* Provides not existing mime types.
*
* @return Generator
*/
@@ -344,7 +344,7 @@ class MimeTypesTest extends BaseTestCase
}
/**
* Provides mime types used to get extensions
* Provides mime types used to get extensions.
*
* @return Generator
*/
@@ -357,7 +357,7 @@ class MimeTypesTest extends BaseTestCase
],
[
'application/x-7z-compressed' => '7z',
'application/json' => 'json',
'application/json' => 'json',
],
];
@@ -374,12 +374,12 @@ class MimeTypesTest extends BaseTestCase
'nb',
'mb',
],
'application/xml' => [
'application/xml' => [
'xml',
'xsl',
],
'audio/mp4' => 'mp4a',
'video/mp4' => [
'audio/mp4' => 'mp4a',
'video/mp4' => [
'mp4',
'mp4v',
'mpg4',
@@ -390,7 +390,7 @@ class MimeTypesTest extends BaseTestCase
}
/**
* Provides mime types used to get extensions as upper case
* Provides mime types used to get extensions as upper case.
*
* @return Generator
*/
@@ -403,7 +403,7 @@ class MimeTypesTest extends BaseTestCase
],
[
'application/x-7z-compressed' => '7Z',
'application/json' => 'JSON',
'application/json' => 'JSON',
],
];
@@ -419,12 +419,12 @@ class MimeTypesTest extends BaseTestCase
'XML',
'XSL',
],
'audio/mp4' => 'MP4A',
'text/html' => [
'audio/mp4' => 'MP4A',
'text/html' => [
'HTML',
'HTM',
],
'video/mp4' => [
'video/mp4' => [
'MP4',
'MP4V',
'MPG4',
@@ -435,7 +435,7 @@ class MimeTypesTest extends BaseTestCase
}
/**
* Provides real file path to get mime type
* Provides real file path to get mime type.
*
* @return Generator
*/
@@ -453,7 +453,7 @@ class MimeTypesTest extends BaseTestCase
}
/**
* Provides real file path to get information if the file is an image
* Provides real file path to get information if the file is an image.
*
* @return Generator
*/

View File

@@ -17,7 +17,7 @@ use Meritoo\Common\Utilities\Miscellaneous;
use stdClass;
/**
* Tests of the Miscellaneous methods (only static functions)
* Tests of the Miscellaneous methods (only static functions).
*
* @author Krzysztof Niziol <krzysztof.niziol@meritoo.pl>
* @copyright Meritoo.pl
@@ -30,7 +30,7 @@ class MiscellaneousTest extends BaseTestCase
public function testGetDirectoryContent()
{
$directoryPath = __DIR__ . '/../';
$directoryPath = __DIR__.'/../';
$filePath = __FILE__;
self::assertNull(Miscellaneous::getDirectoryContent(null));
@@ -123,8 +123,8 @@ class MiscellaneousTest extends BaseTestCase
*/
$uniqueFileName2 = Miscellaneous::getUniqueFileName($originalFileName);
$isCorrect1 = (bool)preg_match($pattern, $uniqueFileName1);
$isCorrect2 = (bool)preg_match($pattern, $uniqueFileName2);
$isCorrect1 = (bool) preg_match($pattern, $uniqueFileName1);
$isCorrect2 = (bool) preg_match($pattern, $uniqueFileName2);
self::assertTrue($isCorrect1);
self::assertTrue($isCorrect2);
@@ -345,8 +345,8 @@ class MiscellaneousTest extends BaseTestCase
{
$suffix = '...';
self::assertEquals('Lorem ipsum' . $suffix, Miscellaneous::substringToWord($this->stringCommaSeparated, 20));
self::assertEquals('Lorem ipsum dolor sit' . $suffix, Miscellaneous::substringToWord($this->stringCommaSeparated, 25));
self::assertEquals('Lorem ipsum'.$suffix, Miscellaneous::substringToWord($this->stringCommaSeparated, 20));
self::assertEquals('Lorem ipsum dolor sit'.$suffix, Miscellaneous::substringToWord($this->stringCommaSeparated, 25));
self::assertEquals('Lorem ipsum dolor', Miscellaneous::substringToWord($this->stringCommaSeparated, 20, ''));
self::assertEquals('Lorem ipsum dolor sit amet, consectetur', Miscellaneous::substringToWord($this->stringCommaSeparated, 40, ''));
@@ -368,26 +368,26 @@ class MiscellaneousTest extends BaseTestCase
/*
* Removing not directory
*/
$directoryPath = sys_get_temp_dir() . '/ipsum.txt';
$directoryPath = sys_get_temp_dir().'/ipsum.txt';
touch($directoryPath);
self::assertTrue(Miscellaneous::removeDirectory($directoryPath));
/*
* Removing simple directory
*/
$directoryPath = sys_get_temp_dir() . '/lorem/ipsum';
$directoryPath = sys_get_temp_dir().'/lorem/ipsum';
mkdir($directoryPath, 0777, true);
self::assertTrue(Miscellaneous::removeDirectory($directoryPath));
/*
* Removing more complex directory
*/
$directory1Path = sys_get_temp_dir() . '/lorem/ipsum';
$directory2Path = sys_get_temp_dir() . '/lorem/dolor/sit';
$directory1Path = sys_get_temp_dir().'/lorem/ipsum';
$directory2Path = sys_get_temp_dir().'/lorem/dolor/sit';
mkdir($directory1Path, 0777, true);
mkdir($directory2Path, 0777, true);
self::assertTrue(Miscellaneous::removeDirectory(sys_get_temp_dir() . '/lorem', false));
self::assertTrue(Miscellaneous::removeDirectory(sys_get_temp_dir().'/lorem', false));
}
/**
@@ -520,8 +520,8 @@ class MiscellaneousTest extends BaseTestCase
'and/the/third',
];
self::assertEquals('/' . implode('/', $paths1), Miscellaneous::concatenatePaths($paths1));
self::assertEquals('/' . implode('/', $paths1), Miscellaneous::concatenatePaths($paths1[0], $paths1[1], $paths1[2]));
self::assertEquals('/'.implode('/', $paths1), Miscellaneous::concatenatePaths($paths1));
self::assertEquals('/'.implode('/', $paths1), Miscellaneous::concatenatePaths($paths1[0], $paths1[1], $paths1[2]));
/*
* For Windows operating system
@@ -721,7 +721,7 @@ class MiscellaneousTest extends BaseTestCase
}
/**
* Provides string to convert characters to latin characters and not lower cased and not human-readable
* Provides string to convert characters to latin characters and not lower cased and not human-readable.
*
* @return Generator
*/
@@ -816,7 +816,7 @@ class MiscellaneousTest extends BaseTestCase
}
/**
* Provides string to convert characters to latin characters and lower cased and human-readable
* Provides string to convert characters to latin characters and lower cased and human-readable.
*
* @return Generator
*/
@@ -911,7 +911,7 @@ class MiscellaneousTest extends BaseTestCase
}
/**
* Provides names of files
* Provides names of files.
*
* @return Generator
*/
@@ -939,7 +939,7 @@ class MiscellaneousTest extends BaseTestCase
}
/**
* Provides string to convert to camel case
* Provides string to convert to camel case.
*
* @return Generator
*/
@@ -965,7 +965,7 @@ class MiscellaneousTest extends BaseTestCase
}
/**
* Provides path used to remove the starting / beginning directory's separator
* Provides path used to remove the starting / beginning directory's separator.
*
* @return Generator
*/
@@ -1009,7 +1009,7 @@ class MiscellaneousTest extends BaseTestCase
}
/**
* Provides path used to remove the ending directory's separator
* Provides path used to remove the ending directory's separator.
*
* @return Generator
*/
@@ -1053,7 +1053,7 @@ class MiscellaneousTest extends BaseTestCase
}
/**
* Provides empty value used to fill missing zeros
* Provides empty value used to fill missing zeros.
*
* @return Generator
*/
@@ -1067,7 +1067,7 @@ class MiscellaneousTest extends BaseTestCase
}
/**
* Provides number used to fill missing zeros
* Provides number used to fill missing zeros.
*
* @return Generator
*/

View File

@@ -22,7 +22,7 @@ use Meritoo\Common\Test\Utilities\Reflection\E;
use Meritoo\Common\Utilities\Reflection;
/**
* Tests of the useful reflection methods
* Tests of the useful reflection methods.
*
* @author Krzysztof Niziol <krzysztof.niziol@meritoo.pl>
* @copyright Meritoo.pl
@@ -217,7 +217,7 @@ class ReflectionTest extends BaseTestCase
}
/**
* Provides invalid class and trait
* Provides invalid class and trait.
*
* @return Generator
*/

View File

@@ -9,7 +9,7 @@
namespace Meritoo\Common\Utilities;
/**
* Tests of the useful regular expressions methods
* Tests of the useful regular expressions methods.
*
* @author Krzysztof Niziol <krzysztof.niziol@meritoo.pl>
* @copyright Meritoo.pl

View File

@@ -12,7 +12,7 @@ use Meritoo\Common\Test\Base\BaseTestCase;
use Meritoo\Common\Utilities\Uri;
/**
* Tests of the useful uri methods (only static functions)
* Tests of the useful uri methods (only static functions).
*
* @author Krzysztof Niziol <krzysztof.niziol@meritoo.pl>
* @copyright Meritoo.pl
@@ -58,7 +58,7 @@ class UriTest extends BaseTestCase
}
/**
* Provides urls to replenish protocol
* Provides urls to replenish protocol.
*
* @return \Generator
*/

View File

@@ -13,7 +13,7 @@ use PHPUnit_Framework_TestCase;
use SimpleXMLElement;
/**
* Tests of the useful XML-related methods (only static functions)
* Tests of the useful XML-related methods (only static functions).
*
* @author Krzysztof Niziol <krzysztof.niziol@meritoo.pl>
* @copyright Meritoo.pl
@@ -32,7 +32,7 @@ class XmlTest extends PHPUnit_Framework_TestCase
$element2 = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8"?><employees />');
$merged = Xml::mergeNodes($element1, $element2);
self::assertEquals('', (string)$merged);
self::assertEquals('', (string) $merged);
/*
* XMLs with data
@@ -41,7 +41,7 @@ class XmlTest extends PHPUnit_Framework_TestCase
$element2 = new SimpleXMLElement($this->advancedXml);
$merged = Xml::mergeNodes($element1, $element2);
self::assertEquals('John', (string)$merged->author[0]->first_name);
self::assertEquals('John', (string) $merged->author[0]->first_name);
}
/**