From 5d893443db6cbfa04e75211c412f0d7e1565d099 Mon Sep 17 00:00:00 2001 From: Alegzander Date: Fri, 18 May 2018 17:26:20 +0500 Subject: [PATCH 1/6] Added phpunit version range to support version higher than 4.7. --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index b7c1deb..11e0090 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ }, "require": { "php": ">=5.5.9", - "phpunit/phpunit": "4.7.*", + "phpunit/phpunit": ">=4.7.0 <7.0.0", "mockery/mockery": "0.9.*", "fzaninotto/faker": "1.*" } From d5df61745bb46fd05a7d242ada03ff449b4b2a1b Mon Sep 17 00:00:00 2001 From: Alegzander Date: Sun, 20 May 2018 00:37:39 +0500 Subject: [PATCH 2/6] Updated description in readme file. --- README.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index c834ef2..f0341a2 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,9 @@ Base test class for unit tests inside 1C-Bitrix framework environment ## note -This package requires latest versions of php (>= 5.5.9). +This package requires latest versions of php (>= 5.5.9) and phpunit (>=4.7.0 <7.0.0) + +It might work fine with latest versions (7+) but was tested only with phpunit ^6 (_6.5.8_). ## installation @@ -21,8 +23,10 @@ If you want to use another bootstrap file set it instead default inside bootstra ## usage -To use this package extend \Osotov\PhpunitForBitrix\BitrixTestCase with your test class. - -This package uses awesome mock framework Mockery to ease mock and stub creation. +If you use _old phpunit_ (>5.0.0) extend `\Osotov\PhpunitForBitrix\BitrixTestCase` class in +your test cases. -Additionally package uses Faker to help you with creation of dummy data. \ No newline at end of file +This class uses mock framework Mockery to ease mock and stub creation and it uses Faker to help you with creation of +dummy data. + +For new php unit (>=5.0.0) use `\PHPUnit\Framework\TestCase`. From 634b56bc6d6be45cbeb652edfdc672f94f2e5eb1 Mon Sep 17 00:00:00 2001 From: Alegzander Date: Mon, 21 May 2018 11:00:40 +0500 Subject: [PATCH 3/6] Updated package description in composer.json. Changed description and project namespace for new package. --- README.md | 6 ++++-- composer.json | 17 +++++++++++------ src/BitrixTestCase.php | 4 ++-- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index f0341a2..516620c 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # phpunit-for-bitrix +Based on [osotov/phpunit-for-bitrix](https://github.com/osotov/phpunit-for-bitrix). + Base test class for unit tests inside 1C-Bitrix framework environment ## note @@ -14,7 +16,7 @@ To install package, run the command below and you will get the latest version ```sh -composer require osotov/phpunit-for-bitrix +composer require dcode/phpunit-for-bitrix ``` Copy phpunit.xml.dist file from package to document root. @@ -23,7 +25,7 @@ If you want to use another bootstrap file set it instead default inside bootstra ## usage -If you use _old phpunit_ (>5.0.0) extend `\Osotov\PhpunitForBitrix\BitrixTestCase` class in +If you use _old phpunit_ (>5.0.0) extend `Dcode\Bitrix\TestCase` class in your test cases. This class uses mock framework Mockery to ease mock and stub creation and it uses Faker to help you with creation of diff --git a/composer.json b/composer.json index 11e0090..7adcd18 100644 --- a/composer.json +++ b/composer.json @@ -1,25 +1,30 @@ { - "name": "osotov/phpunit-for-bitrix", - "description": "Base test class for unit tests inside 1C-Bitrix framework environment", + "name": "dcodeteam/phpunit-for-bitrix", + "type": "library", + "description": "Based on https://github.com/osotov/phpunit-for-bitrix. Base test class for unit tests inside 1C-Bitrix framework environment", "authors": [ { "name": "Mikhail Osotov", "email": "reghan7@gmail.com" + }, + { + "name": "Alexander Lushnikov", + "email": "alegz@dcode.team" } ], "keywords": ["bitrix", "phpunit"], - "homepage": "https://github.com/osotov/phpunit-for-bitrix", + "homepage": "https://github.com/dcodeteam/phpunit-for-bitrix", "license": "MIT", "autoload": { "psr-4": { - "Osotov\\PhpunitForBitrix\\": "src/" + "Dcode\\Bitrix\\": "src/" }, "files": ["bootstrap.php"] }, "require": { "php": ">=5.5.9", - "phpunit/phpunit": ">=4.7.0 <7.0.0", - "mockery/mockery": "0.9.*", + "phpunit/phpunit": ">=4.7.0", + "mockery/mockery": ">=0.9.0", "fzaninotto/faker": "1.*" } } diff --git a/src/BitrixTestCase.php b/src/BitrixTestCase.php index bfef2af..1cbf8c6 100644 --- a/src/BitrixTestCase.php +++ b/src/BitrixTestCase.php @@ -1,6 +1,6 @@ Date: Mon, 21 May 2018 11:14:24 +0500 Subject: [PATCH 4/6] Fixed package name in description. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 516620c..bb8ce82 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ To install package, run the command below and you will get the latest version ```sh -composer require dcode/phpunit-for-bitrix +composer require dcodeteam/phpunit-for-bitrix ``` Copy phpunit.xml.dist file from package to document root. From 1163fb71567564a28fd6ac474ed1b6e997968218 Mon Sep 17 00:00:00 2001 From: Alegzander Date: Mon, 21 May 2018 11:24:51 +0500 Subject: [PATCH 5/6] Fixed path to bootstrap in phpunit.xml.dist. --- phpunit.xml.dist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 82cce0b..7d01c98 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,6 +1,6 @@ From 4bf690210a548f7e9b06c2ea33bf331e130eb9dd Mon Sep 17 00:00:00 2001 From: Alegzander Date: Mon, 21 May 2018 15:57:15 +0500 Subject: [PATCH 6/6] Removed bootstrap.php from composer files section to disable it's auto-include. Was breaking bitrix during development. --- composer.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 7adcd18..e97016d 100644 --- a/composer.json +++ b/composer.json @@ -18,8 +18,7 @@ "autoload": { "psr-4": { "Dcode\\Bitrix\\": "src/" - }, - "files": ["bootstrap.php"] + } }, "require": { "php": ">=5.5.9",