Giter Site home page Giter Site logo

voicon / bitrix-ci Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sheerockoff/bitrix-ci

0.0 0.0 0.0 5.59 MB

Минимальная сборка Bitrix для использования в тестировании

License: The Unlicense

TSQL 9.81% PHP 88.61% Hack 0.01% HTML 1.58%

bitrix-ci's Introduction

Bitrix CI Build

PHPUnit Code Size

Минимальный сборка Bitrix для использования в тестировании.

Быстрый старт

Устанавливаем.

composer require --dev sheerockoff/bitrix-ci

Подключаем зависимости.

<?php

require 'vendor/autoload.php';

Подключение к базе данных настраивается переменными окружения MYSQL_HOST, MYSQL_DATABASE, MYSQL_USER и MYSQL_PASSWORD. Они могут быть переопределены в PHP.

putenv('MYSQL_HOST=localhost');
putenv('MYSQL_DATABASE=bitrix_ci');
putenv('MYSQL_USER=user');
putenv('MYSQL_PASSWORD=password');

Разворачиваем дамп MySQL.

\Sheerockoff\BitrixCi\Bootstrap::migrate();

Подключаем Bitrix.

\Sheerockoff\BitrixCi\Bootstrap::bootstrap();

Тестируем код, который зависит от API Bitrix.

/**
 * @param array $stack
 * @return array
 */
public function testCanGetBitrixElement(array $stack)
{
    $element = CIBlockElement::GetList(null, ['ID' => $stack['id']])->GetNextElement();
    $this->assertInstanceOf(_CIBElement::class, $element);
    
    $fields = $element->GetFields();
    $this->assertEquals($stack['id'], $fields['ID']);
    
    return $stack;
}

Список подключенных модулей

bitrix-ci's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.