From 02e482854fd2ac3f1e2b09d853c9379df163050c Mon Sep 17 00:00:00 2001 From: Joshua Estes Date: Thu, 17 Jul 2014 15:52:39 -0400 Subject: [PATCH] Working on added tests to the project --- .gitignore | 1 + .travis.yml | 1 + LICENSE | 2 +- .../Bitcoins/Model/PaymentMethodTest.php | 87 +++++++++++++++++++ .../Bitpay/Bitcoins/tests/bootstrap.php | 35 ++++++++ build.xml | 81 +++++++++++++++-- build/build.properties | 13 +-- build/n98-magerun.yaml | 28 ++++++ build/phpunit.xml.dist | 11 ++- build/travis.properties | 10 +-- composer.json | 6 ++ 11 files changed, 252 insertions(+), 23 deletions(-) create mode 100644 app/code/community/Bitpay/Bitcoins/tests/Bitpay/Bitcoins/Model/PaymentMethodTest.php create mode 100644 app/code/community/Bitpay/Bitcoins/tests/bootstrap.php create mode 100644 build/n98-magerun.yaml diff --git a/.gitignore b/.gitignore index 0b34963..8f41432 100644 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,7 @@ lib/bitpay/bp_config.php /build/cache/ /build/docs/ /build/logs/ +/build/magento/ /vendor/ composer.lock composer.phar diff --git a/.travis.yml b/.travis.yml index e714753..8027ea5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,4 +30,5 @@ script: ./bin/phing -propertyfile build/travis.properties build-travis cache: directories: - build/cache/ + - build/magento/ - vendor/ diff --git a/LICENSE b/LICENSE index 7a8d8f8..5dd2731 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2011-2014 BitPay LLC +Copyright (c) 2011-2014 BitPay Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/app/code/community/Bitpay/Bitcoins/tests/Bitpay/Bitcoins/Model/PaymentMethodTest.php b/app/code/community/Bitpay/Bitcoins/tests/Bitpay/Bitcoins/Model/PaymentMethodTest.php new file mode 100644 index 0000000..623c1d1 --- /dev/null +++ b/app/code/community/Bitpay/Bitcoins/tests/Bitpay/Bitcoins/Model/PaymentMethodTest.php @@ -0,0 +1,87 @@ +assertTrue($paymentMethod->canUseForCurrency('USD')); + } + + public function testCanUseCheckout() + { + } + + public function testIsApiKeyConfigured() + { + } + + public function testIsTransactionSpeedConfigured() + { + } + + public function testAuthorize() + { + } + + public function testCheckForPayment() + { + } + + public function testInvoiceOrder() + { + } + + public function testMarkOrderPaid() + { + } + + public function testMarkOrderComplete() + { + } + + public function testMarkOrderCancelled() + { + } + + public function testExtractAddress() + { + } + + public function testCreateInvoiceAndRedirect() + { + } + + public function testGetOrderPlaceRedirectUrl() + { + } + + public function testGetQuoteHash() + { + } +} diff --git a/app/code/community/Bitpay/Bitcoins/tests/bootstrap.php b/app/code/community/Bitpay/Bitcoins/tests/bootstrap.php new file mode 100644 index 0000000..50c8c64 --- /dev/null +++ b/app/code/community/Bitpay/Bitcoins/tests/bootstrap.php @@ -0,0 +1,35 @@ + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/build.properties b/build/build.properties index 248d96f..f07950e 100644 --- a/build/build.properties +++ b/build/build.properties @@ -22,11 +22,12 @@ # Running a build locally, this also is used # to define all the default properties. -DB_USER=root -DB_PASS=root -DB_NAME=magento -DB_HOST=127.0.0.1 -MAGENTO_VERSION=1.9.0.1 +db.user=root +db.pass= +db.name=magento +db.host=127.0.0.1 +magento.version=1.9.0.1 +magento.baseurl=http://www.localhost.com #### # @@ -149,5 +150,5 @@ phpcs.ignore=vendor --ignore=bin --ignore=build --ignore=tests/ # phpdoc.directory=${project.source}/ phpdoc.target=${project.docsdir}/api -phpdoc.ignore=vendor/,bin/,tests/ +phpdoc.ignore=vendor/,bin/,tests/,build/ #### phpdoc #### diff --git a/build/n98-magerun.yaml b/build/n98-magerun.yaml new file mode 100644 index 0000000..246b2ea --- /dev/null +++ b/build/n98-magerun.yaml @@ -0,0 +1,28 @@ +# The MIT License (MIT) +# +# Copyright (c) 2011-2014 BitPay LLC +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +commands: + N98\Magento\Command\Installer\InstallCommand: + installation: + defaults: + currency: USD + locale: en_US + timezone: America/New_York diff --git a/build/phpunit.xml.dist b/build/phpunit.xml.dist index 38d2db5..f501086 100644 --- a/build/phpunit.xml.dist +++ b/build/phpunit.xml.dist @@ -27,7 +27,7 @@ - tests/ + magento/app/code/community/Bitpay/Bitcoins/tests/ - app/ - lib/ + magento/app/code/community/Bitpay/Bitcoins/ + magento/lib/bitpay + + magento/app/code/community/Bitpay/Bitcoins/tests + diff --git a/build/travis.properties b/build/travis.properties index 796edbc..6a14969 100644 --- a/build/travis.properties +++ b/build/travis.properties @@ -21,11 +21,11 @@ # THE SOFTWARE. # Properties file for running a build on Travis CI -DB_USER=travis -DB_PASS= -DB_NAME=magento -DB_HOST=127.0.0.1 -MAGENTO_VERSION=1.9.0.1 +db.user=travis +db.pass= +db.name=magento +db.host=127.0.0.1 +magento.version=1.9.0.1 #### # diff --git a/composer.json b/composer.json index 43faa1b..83b6770 100644 --- a/composer.json +++ b/composer.json @@ -11,6 +11,12 @@ "issues": "https://github.com/bitpay/magento-plugin/issues", "source": "https://github.com/bitpay/magento-plugin" }, + "repositories": [ + { + "type": "vcs", + "url": "https://github.com/colinmollenhour/modman.git" + } + ], "require": { "composer/installers": "~1.0" },