Skip to content

Commit

Permalink
ICanBoogie update
Browse files Browse the repository at this point in the history
  • Loading branch information
olvlvl committed Mar 24, 2017
1 parent cb02157 commit c243f0d
Show file tree
Hide file tree
Showing 16 changed files with 69 additions and 56 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
.gitignore export-ignore
.travis.yml export-ignore
Makefile export-ignore
phpunit.xml.dist export-ignore
phpunit.xml export-ignore
tests/ export-ignore
15 changes: 3 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,17 @@ cache:
directories:
- $COMPOSER_CACHE_DIR
- $HOME/.composer/cache
- $TRAVIS_BUILD_DIR/build

language: php

php:
- 5.6
- 7.0
- 7.1
- hhvm

matrix:
allow_failures:
- php: hhvm

before_script:
- if [[ $TRAVIS_PHP_VERSION != "5.6" ]]; then composer install --prefer-dist; fi
- if [[ $TRAVIS_PHP_VERSION = "5.6" ]]; then composer require satooshi/php-coveralls --prefer-dist; fi
- if [[ $TRAVIS_PHP_VERSION != "5.6" ]]; then phpenv config-rm xdebug.ini; fi

script:
- mkdir -p build/logs
- phpunit --coverage-clover build/logs/clover.xml

after_success:
- if [[ "$TRAVIS_PHP_VERSION" = "5.6" ]]; then php vendor/bin/coveralls -v; fi
- if [[ $TRAVIS_PHP_VERSION == "5.6" ]]; then make test-coveralls; else make test; fi
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
The icanboogie/bind-activerecord package is free software.
icanboogie/bind-activerecord is free software.
It is released under the terms of the following BSD License.

Copyright (c) 2015-2016 by Olivier Laviale
Copyright (c) 2015-2017 by Olivier Laviale
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
Expand Down
29 changes: 23 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,42 @@

PACKAGE_NAME = icanboogie/bind-activerecord
PACKAGE_VERSION = 4.0
PHPUNIT_VERSION = phpunit-5.7.phar
PHPUNIT_FILENAME = build/$(PHPUNIT_VERSION)
PHPUNIT = php $(PHPUNIT_FILENAME)

# do not edit the following lines

all: $(PHPUNIT_FILENAME) vendor

usage:
@echo "test: Runs the test suite.\ndoc: Creates the documentation.\nclean: Removes the documentation, the dependencies and the Composer files."

vendor:
@composer install --prefer-dist
@COMPOSER_ROOT_VERSION=$(PACKAGE_VERSION) composer install

update:
@composer update --prefer-dist
@COMPOSER_ROOT_VERSION=$(PACKAGE_VERSION) composer update

autoload: vendor
@composer dump-autoload

test: vendor
@phpunit
$(PHPUNIT_FILENAME):
mkdir -p build
wget https://phar.phpunit.de/$(PHPUNIT_VERSION) -O $(PHPUNIT_FILENAME)

test: all
@$(PHPUNIT)

test-coverage: vendor
test-coverage: all
@mkdir -p build/coverage
@phpunit --coverage-html build/coverage
@$(PHPUNIT) --coverage-html ../build/coverage

test-coveralls: all
@mkdir -p build/logs
COMPOSER_ROOT_VERSION=$(PACKAGE_VERSION) composer require satooshi/php-coveralls
@$(PHPUNIT) --coverage-clover ../build/logs/clover.xml
php vendor/bin/coveralls -v

doc: vendor
@mkdir -p build/docs
Expand All @@ -36,3 +51,5 @@ clean:
@rm -fR build
@rm -fR vendor
@rm -f composer.lock

.PHONY: all autoload doc clean test test-coverage test-coveralls update
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

[![Release](https://img.shields.io/packagist/v/ICanBoogie/bind-activerecord.svg)](https://packagist.org/packages/icanboogie/bind-activerecord)
[![Build Status](https://img.shields.io/travis/ICanBoogie/bind-activerecord.svg)](http://travis-ci.org/ICanBoogie/bind-activerecord)
[![HHVM](https://img.shields.io/hhvm/icanboogie/bind-activerecord.svg)](http://hhvm.h4cc.de/package/icanboogie/bind-activerecord)
[![Code Quality](https://img.shields.io/scrutinizer/g/ICanBoogie/bind-activerecord.svg)](https://scrutinizer-ci.com/g/ICanBoogie/bind-activerecord)
[![Code Coverage](https://img.shields.io/coveralls/ICanBoogie/bind-activerecord.svg)](https://coveralls.io/r/ICanBoogie/bind-activerecord)
[![Packagist](https://img.shields.io/packagist/dt/icanboogie/bind-activerecord.svg)](https://packagist.org/packages/icanboogie/bind-activerecord)
Expand Down Expand Up @@ -181,8 +180,8 @@ The package is continuously tested by [Travis CI](http://about.travis-ci.org/).



[documentation]: http://api.icanboogie.org/bind-activerecord/4.0/
[ConnectionCollection]: http://api.icanboogie.org/activerecord/4.0/class-ICanBoogie.ActiveRecord.ConnectionCollection.html
[ModelCollection]: http://api.icanboogie.org/activerecord/4.0/class-ICanBoogie.ActiveRecord.ModelCollection.html
[documentation]: https://icanboogie.org/api/bind-activerecord/4.0/
[ConnectionCollection]: https://icanboogie.org/api/activerecord/4.0/class-ICanBoogie.ActiveRecord.ConnectionCollection.html
[ModelCollection]: https://icanboogie.org/api/activerecord/4.0/class-ICanBoogie.ActiveRecord.ModelCollection.html
[icanboogie/activerecord]: https://github.com/ICanBoogie/ActiveRecord
[ICanBoogie]: https://github.com/ICanBoogie/ICanBoogie
19 changes: 9 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,41 @@
"name": "icanboogie/bind-activerecord",
"type": "library",
"description": "Binds ActiveRecord to ICanBoogie",
"homepage": "http://icanboogie.org/",
"homepage": "https://icanboogie.org/",
"license": "BSD-3-Clause",
"authors": [
{
"name": "Olivier Laviale",
"email": "olivier.laviale@gmail.com",
"homepage": "http://www.weirdog.com/",
"role" : "Developer"
"homepage": "https://olvlvl.com/",
"role": "Developer"
}
],
"support": {
"issues": "https://github.com/ICanBoogie/bind-activerecord/issues",
"source": "https://github.com/ICanBoogie/bind-activerecord"
},

"minimum-stability": "dev",
"prefer-stable": true,

"prefer-dist": true,
"require": {
"php": ">=5.6",
"icanboogie/icanboogie": "^4.0",
"icanboogie/activerecord": "^4.0"
},

"autoload": {
"psr-4": {
"ICanBoogie\\Binding\\ActiveRecord\\": "lib"
}
},
"autoload-dev": {
"psr-4": {
"ICanBoogie\\Binding\\ActiveRecord\\": "tests"
}
"ICanBoogie\\Binding\\ActiveRecord\\": "tests/lib"
},
"classmap": [
"tests/Application.php"
]
},

"extra": {
"icanboogie": {
"config-constructor": {
Expand All @@ -46,7 +46,6 @@
"config-path": "config"
}
},

"scripts": {
"post-autoload-dump": "ICanBoogie\\Autoconfig\\Hooks::on_autoload_dump"
}
Expand Down
4 changes: 2 additions & 2 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
>
<testsuites>
<testsuite name="icanboogie/bind-activerecord">
<directory>./tests</directory>
<directory>./tests/lib</directory>
</testsuite>
</testsuites>

<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<whitelist processUncoveredFilesFromWhitelist="false">
<directory suffix=".php">./lib</directory>
</whitelist>
</filter>
Expand Down
17 changes: 17 additions & 0 deletions tests/Application.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

/*
* This file is part of the ICanBoogie package.
*
* (c) Olivier Laviale <olivier.laviale@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace ICanBoogie;

class Application extends ApplicationAbstract
{

}
File renamed without changes.
File renamed without changes.
File renamed without changes.
20 changes: 3 additions & 17 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,8 @@

namespace ICanBoogie;

$autoload = require __DIR__ . '/../vendor/autoload.php';
$autoload->addPsr4('ICanBoogie\Binding\ActiveRecord\\', __DIR__);
chdir(__DIR__);

class Application extends Core
{
use Binding\ActiveRecord\ApplicationBindings;
}
require __DIR__ . '/../vendor/autoload.php';

boot(array_merge_recursive(get_autoconfig(), [

'config-path' => [

__DIR__ . '/config/all' => 10,
__DIR__ . '/config/default' => 10,
__DIR__ . '/config/localhost' => 10

]

]));
boot();
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@
namespace ICanBoogie\Binding\ActiveRecord;

use ICanBoogie\Validate\ValidationErrors;
use PHPUnit\Framework\TestCase;

/**
* @small
*/
class ActiveRecordTest extends \PHPUnit_Framework_TestCase
class ActiveRecordTest extends TestCase
{
public function test_validate()
{
Expand Down
3 changes: 2 additions & 1 deletion tests/HooksTest.php → tests/lib/HooksTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@

use function ICanBoogie\app;
use function ICanBoogie\ActiveRecord\get_model;
use PHPUnit\Framework\TestCase;

class HooksTest extends \PHPUnit_Framework_TestCase
class HooksTest extends TestCase
{
/**
* @var Application
Expand Down
File renamed without changes.
2 changes: 2 additions & 0 deletions tests/repository/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!.gitignore

0 comments on commit c243f0d

Please sign in to comment.