Skip to content

Commit

Permalink
Зависимости --dev
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalikxp committed Oct 1, 2024
1 parent cd6bb02 commit 9394d92
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 32 deletions.
5 changes: 2 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
}
},
"require": {
"php": ">=7.4",
"php": "^7.4||^8.0",
"ext-mysqli": "*"
},
"autoload-dev": {
Expand All @@ -28,7 +28,6 @@
}
},
"require-dev": {
"phpunit/phpunit": "^9.0",
"symfony/var-dumper": "^3.4"
"phpunit/phpunit": "*"
}
}
29 changes: 13 additions & 16 deletions tests/CatalogTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,6 @@

class CatalogTest extends TestCase
{
public static function tearDownAfterClass(): void
{
CIBlockType::Delete('bitrix_ci_test');

$cCatalogGroup = new CCatalogGroup();
if ($catalogGroup = CCatalogGroup::GetList(null, ['NAME' => 'OUTLET'])->Fetch()) {
$cCatalogGroup->Delete($catalogGroup['ID']);
}

CCurrency::Delete('CAP');

if ($catalogStore = CCatalogStore::GetList(null, ['XML_ID' => 'VAULT13'])->Fetch()) {
CCatalogStore::Delete($catalogStore['ID']);
}
}

public function testCanLoadModule()
{
global $APPLICATION;
Expand All @@ -45,6 +29,19 @@ public function testCanAddCatalog(array $stack = [])
{
global $APPLICATION;

CIBlockType::Delete('bitrix_ci_test');

$cCatalogGroup = new CCatalogGroup();
if ($catalogGroup = CCatalogGroup::GetList(null, ['NAME' => 'OUTLET'])->Fetch()) {
$cCatalogGroup->Delete($catalogGroup['ID']);
}

CCurrency::Delete('CAP');

if ($catalogStore = CCatalogStore::GetList(null, ['XML_ID' => 'VAULT13'])->Fetch()) {
CCatalogStore::Delete($catalogStore['ID']);
}

$cIBlockType = new CIBlockType();
$isAdded = $cIBlockType->Add([
'ID' => 'bitrix_ci_test',
Expand Down
16 changes: 8 additions & 8 deletions tests/HighloadBlockTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace BitrixToolkit\BitrixCi\Test;

use Bitrix\Highloadblock\HighloadBlockTable;
use Bitrix\Main\Application;
use Bitrix\Main\ORM\Data\AddResult;
use Bitrix\Main\ORM\Data\DeleteResult;
use Bitrix\Main\ORM\Data\UpdateResult;
Expand All @@ -14,14 +15,6 @@

class HighloadBlockTest extends TestCase
{
public static function tearDownAfterClass(): void
{
$exist = HighloadBlockTable::getList(['filter' => ['TABLE_NAME' => 'test_data']])->fetch();
if (!empty($exist['ID'])) {
HighloadBlockTable::delete($exist['ID']);
}
}

public function testCanLoadModule()
{
global $APPLICATION;
Expand All @@ -34,6 +27,13 @@ public function testCanLoadModule()
*/
public function testCanAddHighloadBlock()
{
$exist = HighloadBlockTable::getList(['filter' => ['TABLE_NAME' => 'test_data']])->fetch();
if (!empty($exist['ID'])) {
HighloadBlockTable::delete($exist['ID']);
}

Application::getConnection()->query('DROP TABLE IF EXISTS test_data');

$result = HighloadBlockTable::add([
'NAME' => 'TestData',
'TABLE_NAME' => 'test_data'
Expand Down
7 changes: 2 additions & 5 deletions tests/IBlockTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@

class IBlockTest extends TestCase
{
public static function tearDownAfterClass(): void
{
CIBlockType::Delete('bitrix_ci_test');
}

public function testCanLoadModule()
{
global $APPLICATION;
Expand All @@ -27,6 +22,8 @@ public function testCanLoadModule()
*/
public function testCanAddIBlockType()
{
CIBlockType::Delete('bitrix_ci_test');

$cIBlockType = new CIBlockType();
$isAdded = $cIBlockType->Add([
'ID' => 'bitrix_ci_test',
Expand Down

0 comments on commit 9394d92

Please sign in to comment.