Add .travis.yml. Add tests.
This commit is contained in:
parent
4498f7f5a9
commit
bfecefbdee
|
@ -0,0 +1,18 @@
|
|||
sudo: required
|
||||
dist: trusty
|
||||
group: edge
|
||||
|
||||
language: php
|
||||
|
||||
php:
|
||||
- 7.0
|
||||
- 7.1
|
||||
- 7.2
|
||||
- nightly
|
||||
|
||||
script:
|
||||
- phpize
|
||||
- ./configure
|
||||
- make
|
||||
- make test
|
||||
- sudo make install
|
|
@ -1,5 +1,8 @@
|
|||
# ext-collections
|
||||
|
||||
[![Travis-CI](https://travis-ci.org/CismonX/ext-collections.svg?branch=master)](https://travis-ci.org/CismonX/ext-collections)
|
||||
[![MIT license](https://img.shields.io/badge/licence-MIT-blue.svg)](https://opensource.org/licenses/MIT)
|
||||
|
||||
## 1. Introduction
|
||||
|
||||
This PHP extension provides a set of useful functional-style operations on PHP arrays, which makes array manipulation simple and scalable.
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
PHP_ARG_ENABLE(collections, for collections support,
|
||||
[ --enable-collections Enable collections support])
|
||||
|
||||
PHP_ARG_ENABLE(collections, for debug support,
|
||||
[ --enable-collections-debug Compile with debug symbols])
|
||||
PHP_ARG_ENABLE(collections-debug, for debug support,
|
||||
[ --enable-collections-debug Compile with debug symbols], no, no)
|
||||
|
||||
if test "$PHP_COLLECTIONS" != "no"; then
|
||||
if test "$PHP_COLLECTIONS_DEBUG" != "no"; then
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
--TEST--
|
||||
Check whether the extension is loaded.
|
||||
--FILE--
|
||||
<?php
|
||||
if (!extension_loaded('collections'))
|
||||
echo "Extension not loaded.", PHP_EOL;
|
||||
?>
|
||||
--EXPECT--
|
|
@ -0,0 +1,11 @@
|
|||
--TEST--
|
||||
Test Collection::init().
|
||||
--FILE--
|
||||
<?php
|
||||
$array = ['a' => 'b'];
|
||||
$collection = Collection::init($array);
|
||||
$collection2 = Collection::init($collection);
|
||||
if ($array != $collection2->toArray())
|
||||
echo 'Collection::init() failed.', PHP_EOL;
|
||||
?>
|
||||
--EXPECT--
|
Reference in New Issue