Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ composer.lock
dev/
clover*
*.phar
./coverage/
81 changes: 4 additions & 77 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,88 +1,15 @@
dist: trusty # fix for travis not updating their HHVM images
language: php
php:
- 5.6
- 7.0
- 7.1
- 7.2
- hhvm

# only build master branch (and PRs)
branches:
only:
- "master"

cache:
directories:
- $HOME/.composer/cache/files

before_install:
# disable XDEBUG unless specified to be used
- sh -c 'if [ "${WITH_XDEBUG}" = "false" ]; then phpenv config-rm xdebug.ini && echo "xdebug disabled" || exit 0; fi'

install:
- composer update
- sh -c 'if [ "${TEST_FRAMEWORK}" != "" ]; then composer global require fxp/composer-asset-plugin; fi'

script:
# run tests when phpcs is not enabled
- if [[ "${RUN_PHPUNIT}" != "false" ]]; then
export RUN_PHPUNIT="true";
fi
- sh -c 'if [ "${PHPCS}" = "true" ]; then export RUN_PHPUNIT=false; fi'
- sh -c 'if [ "${RUN_PHPUNIT}" = "true" ]; then ./vendor/bin/phpunit -c ./phpunit.xml; fi'
- sh -c 'if [ "${RUN_PHPUNIT}" = "true" ]; then ./vendor/bin/phpunit -c ./phpunit-recovery.xml; fi';

# run phpcs when enabled
- sh -c 'if [ "${PHPCS}" = "true" ]; then ./vendor/bin/phpcs --standard=./phpcs.xml -n ./src/ && echo "PHPCS OK"; fi'

# run framework tests when enabled
- if [[ "${TEST_FRAMEWORK}" != "" ]]; then
if [[ "${TRAVIS_PULL_REQUEST}" = false ]]; then
git fetch --unshallow;
php framework-test.php dev-${TRAVIS_BRANCH} && echo "Framework integration OK";
elif [[ "${TRAVIS_PULL_REQUEST_BRANCH}" != "" ]]; then
php framework-test.php dev-${TRAVIS_PULL_REQUEST_BRANCH} && echo "Framework integration OK";
fi
fi

# check coverage if report was generated (requires xdebug enabled)
- sh -c 'if [ -e clover.xml ]; then php coverage-checker.php clover.xml 70; fi'

after_script:
- |
if [ "${WITH_XDEBUG}" = "true" ]; then
wget https://scrutinizer-ci.com/ocular.phar &&
php ocular.phar code-coverage:upload --format=php-clover clover.xml
fi
- |
if [ "${WITH_XDEBUG}" = "true" ]; then
vendor/bin/coveralls
fi

notifications:
slack:
secure: fwLiJFbxPCyY6+REN3XZ06RlffSVua3tW5Ih/p4xwp2KXNdcCldWCmziVhf65JGYaRU20M4HEOOcD+IpOI/IjpNHjF/+6OmtUGfkT9OfDCmuElqyq8UT6ck+xfb7FVtK42zkx0U3xC1qCclbFjY1Rht7vt5VnGN7Q3qJ3ax7mcM=

env:
global:
- BLOCKTRAIL_SDK_THROTTLE_BTCCOM=0.01
- secure: d4a4n3bdFO/TZGBnEO0zOarL7kTkh4WyH6U+sEQoqe7Wbs1OIN014JXqYZZn2TDQ8kKjxKGi63TiDvh2wvKF+B7dlOo3/WvqNOEA48eVmRI3/LQsAAcmUNIK6YnBN2YgIy0kl8ycDvx0W7hK/A6FFmbnGTJnG6vnQ5NmBe1G3ug=
- secure: ndOLTmYQgNKnr4qXt9/1TjYUDuGFn7K/v5L4urwIAxwD1jJYLHpntvhjTehQq34VX2uIQeDn0Zd4qyorpJxTI5Pmow51j5ZmtA0lS8TaFTwfWc+GZIG7UT3vcoHC5U0o54KJAlumSSncTMttPPfYsD7+8+8KYEjrOlXg6djq5fI=
# BLOCKTRAIL_SDK_BTCCOM_API_ENDPOINT
- secure: "hJDN/XyeCJVi86R08zPN/xpI/7U+SU6tWmfnVp4wF6cyZmdDY6UztSa5FaS/RRh0mF2M66PoW00VxyoZ7dj0avZrZWwILYdBpwiIWCg2Ay7rkBGbE/kiWuMfOAVpf8x3zO/ArunJC7spiWW+amTFxk0sutkz84bLxyQahsPmVgE="
matrix:
- PHPCS=false WITH_XDEBUG=false # default disable phpcs run and disable xdebug

matrix:
exclude:
# exclude the php7.0 job without xdebug so we can add one with xdebug
- php: 7.0
env: PHPCS=false WITH_XDEBUG=false
include:
# php7.0 run with xdebug for code coverage (slooooow)
- php: 7.0
env: PHPCS=false WITH_XDEBUG=true
# php5.6 run with phpcs (won't run tests, only phpcs)
- php: 7.0
env: PHPCS=true WITH_XDEBUG=false
# DEBUG
- php -i
- curl -v 'https://api.blocktrail.com/v1/BTC/price?api_key=MY_APIKEY'
- php -dopenssl.capath=/etc/ssl/certs/ -dcurl.capath=/etc/ssl/certs/ -dcapath=/etc/ssl/certs/ curl.php
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@
"spomky-labs/php-aes-gcm": "v1.2.0"
},
"require-dev": {
"phpunit/phpunit": "4.3.*",
"phpunit/phpunit": "5.*",
"mockery/mockery": "1.0.*",
"squizlabs/php_codesniffer": "2.*",
"php-coveralls/php-coveralls": "^1.0"
}
Expand Down
39 changes: 39 additions & 0 deletions curl.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php


$sslVersions = [
CURL_SSLVERSION_DEFAULT,
CURL_SSLVERSION_TLSv1,
CURL_SSLVERSION_TLSv1_0,
CURL_SSLVERSION_TLSv1_1,
CURL_SSLVERSION_TLSv1_2,
CURL_SSLVERSION_SSLv2,
CURL_SSLVERSION_SSLv3,
];

var_dump(curl_version());

foreach ($sslVersions as $sslVersion) {
var_dump($sslVersion);
$ch = curl_init("https://api.blocktrail.com/v1/BTC/price?api_key=MY_APIKEY");

curl_setopt_array($ch, [
CURLOPT_VERBOSE => true,
CURLOPT_CERTINFO => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_SSL_VERIFYPEER => true,
CURLOPT_FAILONERROR => false,
CURLOPT_TIMEOUT => 10,
CURLOPT_CONNECTTIMEOUT => 10,
CURLOPT_HEADER => true,
CURLOPT_SSLVERSION => $sslVersion,
]);

$result = curl_exec($ch);
$info = curl_getinfo($ch);

curl_close($ch);

var_dump($result);
}
2 changes: 1 addition & 1 deletion phpunit-recovery.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
>
<testsuites>
<testsuite name="Tests">
<file>./tests/WalletRecoveryTest.php</file>
<file>./tests/IntegrationTests/WalletRecoveryTest.php</file>
</testsuite>
</testsuites>
</phpunit>
5 changes: 4 additions & 1 deletion phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
<testsuite name="Tests">
<directory>./tests/</directory>
<directory>./tests/V3Crypt/</directory>
<exclude>./tests/WalletRecoveryTest.php</exclude>
<directory>./tests/Wallet/</directory>
<directory>./tests/Network/</directory>
<directory>./tests/IntegrationTests/</directory>
<exclude>./tests/IntegrationTests/WalletRecoveryTest.php</exclude>
</testsuite>
</testsuites>

Expand Down
Loading