-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cd workaround using pwd to restrict access
- Loading branch information
Showing
46 changed files
with
1,990 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
phpunit.xml | ||
composer.lock | ||
build | ||
vendor | ||
coverage.clover |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
before_commands: | ||
- "composer install --prefer-source" | ||
|
||
tools: | ||
external_code_coverage: | ||
timeout: 600 | ||
php_code_coverage: | ||
enabled: true | ||
test_command: ./vendor/bin/phpunit | ||
php_code_sniffer: | ||
enabled: true | ||
config: | ||
standard: PSR2 | ||
filter: | ||
paths: ["src/*", "tests/*"] | ||
php_cpd: | ||
enabled: true | ||
excluded_dirs: ["build/*", "tests", "vendor"] | ||
php_cs_fixer: | ||
enabled: true | ||
config: | ||
level: all | ||
filter: | ||
paths: ["src/*", "tests/*"] | ||
php_loc: | ||
enabled: true | ||
excluded_dirs: ["build", "tests", "vendor"] | ||
php_mess_detector: | ||
enabled: true | ||
config: | ||
ruleset: phpmd.xml.dist | ||
design_rules: { eval_expression: false } | ||
filter: | ||
paths: ["src/*"] | ||
php_pdepend: | ||
enabled: true | ||
excluded_dirs: ["build", "tests", "vendor"] | ||
php_analyzer: | ||
enabled: true | ||
filter: | ||
paths: ["src/*", "tests/*"] | ||
php_hhvm: | ||
enabled: true | ||
filter: | ||
paths: ["src/*", "tests/*"] | ||
sensiolabs_security_checker: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/sh | ||
set -x | ||
if [ "$TRAVIS_PHP_VERSION" = 'hhvm' ] || [ "$TRAVIS_PHP_VERSION" = 'hhvm-nightly' ] ; then | ||
curl -sS https://getcomposer.org/installer > composer-installer.php | ||
hhvm composer-installer.php | ||
hhvm -v ResourceLimit.SocketDefaultTimeout=30 -v Http.SlowQueryThreshold=30000 composer.phar update --prefer-source | ||
elif [ "$TRAVIS_PHP_VERSION" = '5.3.3' ] ; then | ||
composer self-update | ||
composer update --prefer-source --no-dev | ||
composer dump-autoload | ||
else | ||
composer self-update | ||
composer update --prefer-source | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
language: php | ||
|
||
php: | ||
- 5.3.3 | ||
- 5.3 | ||
- 5.4 | ||
- 5.5 | ||
- 5.6 | ||
- hhvm | ||
|
||
before_script: | ||
- ./.travis.install.sh | ||
- if [ $TRAVIS_PHP_VERSION = '5.6' ]; then PHPUNIT_FLAGS="--coverage-clover coverage.clover"; else PHPUNIT_FLAGS=""; fi | ||
|
||
script: | ||
- if [ $TRAVIS_PHP_VERSION = '5.3.3' ]; then phpunit; fi | ||
- if [ $TRAVIS_PHP_VERSION != '5.3.3' ]; then ./vendor/bin/phpunit $PHPUNIT_FLAGS; fi | ||
- if [ $TRAVIS_PHP_VERSION != '5.3.3' ]; then ./vendor/bin/phpcs --standard=PSR2 ./src/ ./tests/; fi | ||
- if [[ $TRAVIS_PHP_VERSION != '5.3.3' && $TRAVIS_PHP_VERSION != '5.4.29' && $TRAVIS_PHP_VERSION != '5.5.13' ]]; then php -n ./vendor/bin/athletic -p ./tests/DoctrineTest/InstantiatorPerformance/ -f GroupedFormatter; fi | ||
|
||
after_script: | ||
- if [ $TRAVIS_PHP_VERSION = '5.6' ]; then wget https://scrutinizer-ci.com/ocular.phar; php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<ruleset | ||
name="Instantiator rules" | ||
xmlns="http://pmd.sf.net/ruleset/1.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd" | ||
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd" | ||
> | ||
<rule ref="rulesets/cleancode.xml"> | ||
<!-- static access is used for caching purposes --> | ||
<exclude name="StaticAccess"/> | ||
</rule> | ||
<rule ref="rulesets/codesize.xml"/> | ||
<rule ref="rulesets/controversial.xml"/> | ||
<rule ref="rulesets/design.xml"/> | ||
<rule ref="rulesets/naming.xml"/> | ||
<rule ref="rulesets/unusedcode.xml"/> | ||
<rule | ||
name="NPathComplexity" | ||
message="The {0} {1}() has an NPath complexity of {2}. The configured NPath complexity threshold is {3}." | ||
class="PHP_PMD_Rule_Design_NpathComplexity" | ||
> | ||
<properties> | ||
<property name="minimum" description="The npath reporting threshold" value="10"/> | ||
</properties> | ||
</rule> | ||
</ruleset> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0"?> | ||
<phpunit | ||
bootstrap="./vendor/autoload.php" | ||
colors="true" | ||
convertErrorsToExceptions="true" | ||
convertNoticesToExceptions="true" | ||
convertWarningsToExceptions="true" | ||
verbose="true" | ||
stopOnFailure="false" | ||
processIsolation="false" | ||
backupGlobals="false" | ||
syntaxCheck="true" | ||
> | ||
<testsuite name="Doctrine\Instantiator tests"> | ||
<directory>./tests/DoctrineTest/InstantiatorTest</directory> | ||
</testsuite> | ||
<filter> | ||
<whitelist addUncoveredFilesFromWhitelist="true"> | ||
<directory suffix=".php">./src</directory> | ||
</whitelist> | ||
</filter> | ||
</phpunit> |
96 changes: 96 additions & 0 deletions
96
.../instantiator/tests/DoctrineTest/InstantiatorPerformance/InstantiatorPerformanceEvent.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
<?php | ||
/* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
* | ||
* This software consists of voluntary contributions made by many individuals | ||
* and is licensed under the MIT license. For more information, see | ||
* <http://www.doctrine-project.org>. | ||
*/ | ||
|
||
namespace DoctrineTest\InstantiatorPerformance; | ||
|
||
use Athletic\AthleticEvent; | ||
use Doctrine\Instantiator\Instantiator; | ||
|
||
/** | ||
* Performance tests for {@see \Doctrine\Instantiator\Instantiator} | ||
* | ||
* @author Marco Pivetta <ocramius@gmail.com> | ||
*/ | ||
class InstantiatorPerformanceEvent extends AthleticEvent | ||
{ | ||
/** | ||
* @var \Doctrine\Instantiator\Instantiator | ||
*/ | ||
private $instantiator; | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
protected function setUp() | ||
{ | ||
$this->instantiator = new Instantiator(); | ||
|
||
$this->instantiator->instantiate(__CLASS__); | ||
$this->instantiator->instantiate('ArrayObject'); | ||
$this->instantiator->instantiate('DoctrineTest\\InstantiatorTestAsset\\SimpleSerializableAsset'); | ||
$this->instantiator->instantiate('DoctrineTest\\InstantiatorTestAsset\\SerializableArrayObjectAsset'); | ||
$this->instantiator->instantiate('DoctrineTest\\InstantiatorTestAsset\\UnCloneableAsset'); | ||
} | ||
|
||
/** | ||
* @iterations 20000 | ||
* @baseline | ||
* @group instantiation | ||
*/ | ||
public function testInstantiateSelf() | ||
{ | ||
$this->instantiator->instantiate(__CLASS__); | ||
} | ||
|
||
/** | ||
* @iterations 20000 | ||
* @group instantiation | ||
*/ | ||
public function testInstantiateInternalClass() | ||
{ | ||
$this->instantiator->instantiate('ArrayObject'); | ||
} | ||
|
||
/** | ||
* @iterations 20000 | ||
* @group instantiation | ||
*/ | ||
public function testInstantiateSimpleSerializableAssetClass() | ||
{ | ||
$this->instantiator->instantiate('DoctrineTest\\InstantiatorTestAsset\\SimpleSerializableAsset'); | ||
} | ||
|
||
/** | ||
* @iterations 20000 | ||
* @group instantiation | ||
*/ | ||
public function testInstantiateSerializableArrayObjectAsset() | ||
{ | ||
$this->instantiator->instantiate('DoctrineTest\\InstantiatorTestAsset\\SerializableArrayObjectAsset'); | ||
} | ||
|
||
/** | ||
* @iterations 20000 | ||
* @group instantiation | ||
*/ | ||
public function testInstantiateUnCloneableAsset() | ||
{ | ||
$this->instantiator->instantiate('DoctrineTest\\InstantiatorTestAsset\\UnCloneableAsset'); | ||
} | ||
} |
Oops, something went wrong.