Skip to content

Commit

Permalink
#27 added travis ci config
Browse files Browse the repository at this point in the history
  • Loading branch information
lis-dev committed Jan 13, 2019
1 parent 58737d1 commit 6c77a99
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
10 changes: 10 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
language: php
dist: precise
php:
- '5.3'

install:
- composer install

script:
- vendor/phpunit/phpunit/phpunit tests
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[![Build Status](https://travis-ci.com/lis-dev/nova-poshta-api-2.svg?branch=master)](https://travis-ci.com/lis-dev/nova-poshta-api-2)

# Nova Poshta API 2.0
Класс предоставляет доступ к функциям API 2.0 службы доставки Новая Почта

Expand Down Expand Up @@ -241,4 +243,13 @@ $result = $np
* getTiresWheelsList
* getTraysList
* getTypesOfPayers
* getTypesOfPayersForRedelivery
* getTypesOfPayersForRedelivery

# Тесты
Актуальные тесты и примеры использования класса находятся в файле `tests/NovaPoshtaApi2Test.php`

Для запуска тестов локально необходимо выполнить в командной строке
```
composer install
NOVA_POSHTA_API2_KEY=Ваш_ключ_API_2.0 vendor/phpunit/phpunit/phpunit tests
```
5 changes: 3 additions & 2 deletions tests/NovaPoshtaApi2Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class NovaPoshtaApi2Test extends \PHPUnit_Framework_TestCase
*
* @see https://my.novaposhta.ua/settings/index#apikeys
*/
private $key = '';
private static $key = '';

/**
* Test tracking number.
Expand All @@ -40,6 +40,7 @@ public static function setUpBeforeClass()
{
// Disable notices
error_reporting(E_ALL ^ E_NOTICE);
!self::$key and self::$key = getenv('NOVA_POSHTA_API2_KEY');
}

/**
Expand All @@ -48,7 +49,7 @@ public static function setUpBeforeClass()
public function setUp()
{
// Create new instance
$this->np = new NovaPoshtaApi2($this->key);
$this->np = new NovaPoshtaApi2(self::$key);
}

/**
Expand Down

0 comments on commit 6c77a99

Please sign in to comment.