Add pear modules, mail and net_smtp via composer (#93)
Add pear modules, mail and net_smtp via composer, remove php 5.6 build due to phpunit 6
This commit is contained in:
@@ -1,16 +1,26 @@
|
||||
language: php
|
||||
|
||||
php:
|
||||
- 5.6
|
||||
- 7.0
|
||||
- 7.0snapshot
|
||||
- 7.1
|
||||
- 7.1snapshot
|
||||
- master
|
||||
|
||||
sudo: false
|
||||
|
||||
before_script:
|
||||
before_install:
|
||||
- composer self-update
|
||||
- composer install --no-interaction --prefer-source --dev
|
||||
- composer clear-cache
|
||||
|
||||
script: ./vendor/bin/phpunit
|
||||
install:
|
||||
- travis_retry composer update --no-interaction --no-ansi --no-progress --no-suggest --optimize-autoloader --prefer-stable
|
||||
|
||||
script:
|
||||
- ./vendor/bin/phpunit --coverage-clover=coverage.xml
|
||||
|
||||
after_success:
|
||||
- bash <(curl -s https://codecov.io/bash)
|
||||
|
||||
notifications:
|
||||
email: false
|
||||
|
||||
@@ -2,8 +2,52 @@
|
||||
|
||||
All notable changes to `sebastianbergmann/object-enumerator` are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles.
|
||||
|
||||
## 1.0.0 - 2016-MM-DD
|
||||
## [3.0.3] - 2017-08-03
|
||||
|
||||
### Changed
|
||||
|
||||
* Bumped required version of `sebastian/object-reflector`
|
||||
|
||||
## [3.0.2] - 2017-03-12
|
||||
|
||||
### Changed
|
||||
|
||||
* `sebastian/object-reflector` is now a dependency
|
||||
|
||||
## [3.0.1] - 2017-03-12
|
||||
|
||||
### Fixed
|
||||
|
||||
* Objects aggregated in inherited attributes are not enumerated
|
||||
|
||||
## [3.0.0] - 2017-03-03
|
||||
|
||||
### Removed
|
||||
|
||||
* This component is no longer supported on PHP 5.6
|
||||
|
||||
## [2.0.1] - 2017-02-18
|
||||
|
||||
### Fixed
|
||||
|
||||
* Fixed [#2](https://github.com/sebastianbergmann/phpunit/pull/2): Exceptions in `ReflectionProperty::getValue()` are not handled
|
||||
|
||||
## [2.0.0] - 2016-11-19
|
||||
|
||||
### Changed
|
||||
|
||||
* This component is now compatible with `sebastian/recursion-context: ~1.0.4`
|
||||
|
||||
## 1.0.0 - 2016-02-04
|
||||
|
||||
### Added
|
||||
|
||||
* Initial release
|
||||
|
||||
[3.0.3]: https://github.com/sebastianbergmann/object-enumerator/compare/3.0.2...3.0.3
|
||||
[3.0.2]: https://github.com/sebastianbergmann/object-enumerator/compare/3.0.1...3.0.2
|
||||
[3.0.1]: https://github.com/sebastianbergmann/object-enumerator/compare/3.0.0...3.0.1
|
||||
[3.0.0]: https://github.com/sebastianbergmann/object-enumerator/compare/2.0...3.0.0
|
||||
[2.0.1]: https://github.com/sebastianbergmann/object-enumerator/compare/2.0.0...2.0.1
|
||||
[2.0.0]: https://github.com/sebastianbergmann/object-enumerator/compare/1.0...2.0.0
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
Object Enumerator
|
||||
|
||||
Copyright (c) 2016, Sebastian Bergmann <sebastian@phpunit.de>.
|
||||
Copyright (c) 2016-2017, Sebastian Bergmann <sebastian@phpunit.de>.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
|
||||
@@ -4,10 +4,11 @@ Traverses array structures and object graphs to enumerate all referenced objects
|
||||
|
||||
## Installation
|
||||
|
||||
To add Object Enumerator as a local, per-project dependency to your project, simply add a dependency on `sebastian/object-enumerator` to your project's `composer.json` file. Here is a minimal example of a `composer.json` file that just defines a dependency on Object Enumerator 1.0:
|
||||
You can add this library as a local, per-project dependency to your project using [Composer](https://getcomposer.org/):
|
||||
|
||||
composer require sebastian/object-enumerator
|
||||
|
||||
If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency:
|
||||
|
||||
composer require --dev sebastian/object-enumerator
|
||||
|
||||
{
|
||||
"require": {
|
||||
"sebastian/object-enumerator": "~1.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,26 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project name="object-enumerator">
|
||||
<project name="object-enumerator" default="setup">
|
||||
<target name="setup" depends="clean,composer"/>
|
||||
|
||||
<target name="clean" description="Cleanup build artifacts">
|
||||
<delete dir="${basedir}/vendor"/>
|
||||
<delete file="${basedir}/composer.lock"/>
|
||||
</target>
|
||||
|
||||
<target name="composer" depends="clean" description="Install dependencies with Composer">
|
||||
<tstamp>
|
||||
<format property="thirty.days.ago" pattern="MM/dd/yyyy hh:mm aa" offset="-30" unit="day"/>
|
||||
</tstamp>
|
||||
<delete>
|
||||
<fileset dir="${basedir}">
|
||||
<include name="composer.phar"/>
|
||||
<date datetime="${thirty.days.ago}" when="before"/>
|
||||
</fileset>
|
||||
</delete>
|
||||
|
||||
<get src="https://getcomposer.org/composer.phar" dest="${basedir}/composer.phar" skipexisting="true"/>
|
||||
|
||||
<exec executable="php">
|
||||
<arg value="composer.phar"/>
|
||||
<arg value="install"/>
|
||||
<exec executable="composer" taskname="composer">
|
||||
<arg value="update"/>
|
||||
<arg value="--no-interaction"/>
|
||||
<arg value="--no-progress"/>
|
||||
<arg value="--no-ansi"/>
|
||||
<arg value="--no-suggest"/>
|
||||
<arg value="--optimize-autoloader"/>
|
||||
<arg value="--prefer-stable"/>
|
||||
</exec>
|
||||
</target>
|
||||
</project>
|
||||
|
||||
@@ -10,20 +10,26 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.6",
|
||||
"sebastian/recursion-context": "~1.0"
|
||||
"php": "^7.0",
|
||||
"sebastian/object-reflector": "^1.1.1",
|
||||
"sebastian/recursion-context": "^3.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "~5"
|
||||
"phpunit/phpunit": "^6.0"
|
||||
},
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
"src/"
|
||||
]
|
||||
},
|
||||
"autoload-dev": {
|
||||
"classmap": [
|
||||
"tests/_fixture/"
|
||||
]
|
||||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.0.x-dev"
|
||||
"dev-master": "3.0.x-dev"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/5.3/phpunit.xsd"
|
||||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/5.7/phpunit.xsd"
|
||||
bootstrap="vendor/autoload.php"
|
||||
backupGlobals="false"
|
||||
backupStaticAttributes="false"
|
||||
beStrictAboutCoversAnnotation="true"
|
||||
beStrictAboutOutputDuringTests="true"
|
||||
beStrictAboutTestsThatDoNotTestAnything="true"
|
||||
beStrictAboutTodoAnnotatedTests="true"
|
||||
checkForUnintentionallyCoveredCode="true"
|
||||
verbose="true">
|
||||
<testsuite>
|
||||
<directory suffix="Test.php">tests</directory>
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
namespace SebastianBergmann\ObjectEnumerator;
|
||||
|
||||
use SebastianBergmann\ObjectReflector\ObjectReflector;
|
||||
use SebastianBergmann\RecursionContext\Context;
|
||||
|
||||
/**
|
||||
@@ -48,10 +49,11 @@ class Enumerator
|
||||
return $objects;
|
||||
}
|
||||
|
||||
$array = $variable;
|
||||
$processed->add($variable);
|
||||
|
||||
if (is_array($variable)) {
|
||||
foreach ($variable as $element) {
|
||||
foreach ($array as $element) {
|
||||
if (!is_array($element) && !is_object($element)) {
|
||||
continue;
|
||||
}
|
||||
@@ -63,13 +65,10 @@ class Enumerator
|
||||
}
|
||||
} else {
|
||||
$objects[] = $variable;
|
||||
$reflector = new \ReflectionObject($variable);
|
||||
|
||||
foreach ($reflector->getProperties() as $attribute) {
|
||||
$attribute->setAccessible(true);
|
||||
|
||||
$value = $attribute->getValue($variable);
|
||||
$reflector = new ObjectReflector;
|
||||
|
||||
foreach ($reflector->getAttributes($variable) as $value) {
|
||||
if (!is_array($value) && !is_object($value)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -10,10 +10,13 @@
|
||||
|
||||
namespace SebastianBergmann\ObjectEnumerator;
|
||||
|
||||
use SebastianBergmann\ObjectEnumerator\Fixtures\ExceptionThrower;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* @covers SebastianBergmann\ObjectEnumerator\Enumerator
|
||||
*/
|
||||
class EnumeratorTest extends \PHPUnit_Framework_TestCase
|
||||
class EnumeratorTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @var Enumerator
|
||||
@@ -111,16 +114,25 @@ class EnumeratorTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertSame($b, $objects[1]);
|
||||
}
|
||||
|
||||
public function testEnumeratesClassThatThrowsException()
|
||||
{
|
||||
$thrower = new ExceptionThrower();
|
||||
|
||||
$objects = $this->enumerator->enumerate($thrower);
|
||||
|
||||
$this->assertSame($thrower, $objects[0]);
|
||||
}
|
||||
|
||||
public function testExceptionIsRaisedForInvalidArgument()
|
||||
{
|
||||
$this->setExpectedException(InvalidArgumentException::class);
|
||||
$this->expectException(InvalidArgumentException::class);
|
||||
|
||||
$this->enumerator->enumerate(null);
|
||||
}
|
||||
|
||||
public function testExceptionIsRaisedForInvalidArgument2()
|
||||
{
|
||||
$this->setExpectedException(InvalidArgumentException::class);
|
||||
$this->expectException(InvalidArgumentException::class);
|
||||
|
||||
$this->enumerator->enumerate([], '');
|
||||
}
|
||||
|
||||
28
lib/composer/vendor/sebastian/object-enumerator/tests/_fixture/ExceptionThrower.php
vendored
Normal file
28
lib/composer/vendor/sebastian/object-enumerator/tests/_fixture/ExceptionThrower.php
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of Object Enumerator.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace SebastianBergmann\ObjectEnumerator\Fixtures;
|
||||
|
||||
use RuntimeException;
|
||||
|
||||
class ExceptionThrower
|
||||
{
|
||||
private $property;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
unset($this->property);
|
||||
}
|
||||
|
||||
public function __get($property)
|
||||
{
|
||||
throw new RuntimeException;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user