Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
# 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

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

To install package, run the command below and you will get the latest
version

```sh
composer require osotov/phpunit-for-bitrix
composer require dcodeteam/phpunit-for-bitrix
```

Copy phpunit.xml.dist file from package to document root.
Expand All @@ -21,8 +25,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 `Dcode\Bitrix\TestCase` class in
your test cases.

Additionally package uses Faker to help you with creation of dummy data.
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`.
20 changes: 12 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,29 @@
{
"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/"
},
"files": ["bootstrap.php"]
"Dcode\\Bitrix\\": "src/"
}
},
"require": {
"php": ">=5.5.9",
"phpunit/phpunit": "4.7.*",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": ">=4.7.0",
"mockery/mockery": ">=0.9.0",
"fzaninotto/faker": "1.*"
}
}
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- Have your own bootstrap file? Change bootstrap attribute -->
<phpunit
bootstrap="vendor/osotov/phpunit-for-bitrix/bootstrap.php"
bootstrap="vendor/dcodeteam/phpunit-for-bitrix/bootstrap.php"
colors="true"
>
<testsuites>
Expand Down
4 changes: 2 additions & 2 deletions src/BitrixTestCase.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php

namespace Osotov\PhpunitForBitrix;
namespace Dcode\Bitrix;

/**
* Test Case class with some tweaks for usage in 1C-Bitrix framework.
* Class uses Mockery and Faker support.
*
* Class BitrixTestCase
*/
class BitrixTestCase extends \PHPUnit_Framework_TestCase
class TestCase extends \PHPUnit_Framework_TestCase
{
/**
* @var bool
Expand Down