Skip to content

Commit

Permalink
Update jam-auth, fix tests, fix whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
ivank committed Sep 29, 2015
1 parent 6b04be1 commit bc552ee
Show file tree
Hide file tree
Showing 31 changed files with 97 additions and 103 deletions.
2 changes: 1 addition & 1 deletion .scrutinizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ tools:
php_cpd: true
php_hhvm: true
php_analyzer: true
php_pdepend: true
php_pdepend: true
12 changes: 10 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ sudo: false

php:
- 5.4
- 5.5
- 5.6
- 7

matrix:
fast_finish: true
allow_failures:
- php: 7

cache:
directories:
Expand All @@ -20,8 +28,8 @@ install:

before_script:
- mkdir -p build/logs
- mysql -e 'create database `test-promotions`;'
- mysql --default-character-set=utf8 test-promotions < tests/test_data/structure.sql
- mysql -e 'create database `OpenBuildings/promotions`;'
- mysql --default-character-set=utf8 OpenBuildings/promotions < tests/test_data/structure.sql

script:
- phpunit --coverage-clover build/logs/clover.xml
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ Redistribution and use in source and binary forms, with or without modification,
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
Neither the name of the OpenBuildings nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
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 HOLDER 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 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 HOLDER 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.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,3 @@ The ``promotable_purchase`` behavior adds a promo_code_text field to the purchas
Copyright (c) 2012-2013, OpenBuildings Ltd. Developed by Yasen Yanev as part of [clippings.com](http://clippings.com)

Under BSD-3-Clause license, read LICENSE file.

2 changes: 1 addition & 1 deletion classes/Jam/Behavior/Promotable/Purchase.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');

class Jam_Behavior_Promotable_Purchase extends Kohana_Jam_Behavior_Promotable_Purchase {}
class Jam_Behavior_Promotable_Purchase extends Kohana_Jam_Behavior_Promotable_Purchase {}
2 changes: 1 addition & 1 deletion classes/Jam/Validator/Rule/Promocode.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');

class Jam_Validator_Rule_Promocode extends Kohana_Jam_Validator_Rule_Promocode {}
class Jam_Validator_Rule_Promocode extends Kohana_Jam_Validator_Rule_Promocode {}
2 changes: 1 addition & 1 deletion classes/Jam/Validator/Rule/Purchase/Promocode.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');

class Jam_Validator_Rule_Purchase_Promocode extends Kohana_Jam_Validator_Rule_Purchase_Promocode {}
class Jam_Validator_Rule_Purchase_Promocode extends Kohana_Jam_Validator_Rule_Purchase_Promocode {}
12 changes: 6 additions & 6 deletions classes/Kohana/Jam/Behavior/Promotable/Purchase.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
* When you assign promo_code_text then it tries to find the appropriate promo_code and assign it.
* When you assign promo_code object, its code can be retrieved from promo_code_text (two way binding)
*
*
* @package openbuildings\promotions
* @author Ivan Kerin <ikerin@gmail.com>
* @copyright (c) 2013 OpenBuildings Ltd.
Expand All @@ -16,7 +16,7 @@ class Kohana_Jam_Behavior_Promotable_Purchase extends Jam_Behavior {
/**
* @codeCoverageIgnore
*/
public function initialize(Jam_Meta $meta, $name)
public function initialize(Jam_Meta $meta, $name)
{
parent::initialize($meta, $name);

Expand All @@ -32,7 +32,7 @@ public function initialize(Jam_Meta $meta, $name)

/**
* If there is a promo_code object, load it into the promo_code_text
* @param Model_Purchase $purchase
* @param Model_Purchase $purchase
*/
public function model_after_load(Model_Purchase $purchase)
{
Expand All @@ -45,13 +45,13 @@ public function model_after_load(Model_Purchase $purchase)
/**
* If there is a new value in promo_code_text, try to load promo_code object.
* If the new value is NULL, remove it
* @param Model_Purchase $purchase
* @param Model_Purchase $purchase
*/
public function model_after_check(Model_Purchase $purchase)
{
if ($purchase->changed('promo_code_text') AND ! $purchase->errors('promo_code_text'))
{
if ($purchase->promo_code_text)
if ($purchase->promo_code_text)
{
$purchase->promo_code = Jam::find('promo_code', $purchase->promo_code_text);
}
Expand All @@ -61,4 +61,4 @@ public function model_after_check(Model_Purchase $purchase)
}
}
}
}
}
2 changes: 1 addition & 1 deletion classes/Kohana/Jam/Validator/Rule/Purchase/Promocode.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* Validate for available and not expired promo_code_text
* Specific for a purchase model
*
*
* @package openbuildings\promotions
* @author Ivan Kerin <ikerin@gmail.com>
* @copyright (c) 2013 OpenBuildings Ltd.
Expand Down
2 changes: 1 addition & 1 deletion classes/Kohana/Model/Collection/Promo/Code.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ public function available_for_purchase(Model_Purchase $purchase)
->or_where('purchase.id', '=', $purchase->id())
->where_close();
}
}
}
2 changes: 1 addition & 1 deletion classes/Kohana/Model/Collection/Promotion.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ public function not_expired($current_time = NULL)
->or_where('expires_at', '>=', date('Y-m-d H:i:s', $current_time ?: time()))
->where_close();
}
}
}
2 changes: 1 addition & 1 deletion classes/Kohana/Model/Promo/Code.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @license http://spdx.org/licenses/BSD-3-Clause
*/
class Kohana_Model_Promo_Code extends Jam_Model {

/**
* @codeCoverageIgnore
*/
Expand Down
2 changes: 1 addition & 1 deletion classes/Model/Collection/Promo/Code.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?php defined('SYSPATH') OR die('No direct script access.');

class Model_Collection_Promo_Code extends Kohana_Model_Collection_Promo_Code { }
class Model_Collection_Promo_Code extends Kohana_Model_Collection_Promo_Code { }
2 changes: 1 addition & 1 deletion classes/Model/Collection/Promotion.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?php defined('SYSPATH') OR die('No direct script access.');

class Model_Collection_Promotion extends Kohana_Model_Collection_Promotion { }
class Model_Collection_Promotion extends Kohana_Model_Collection_Promotion { }
2 changes: 1 addition & 1 deletion classes/Model/Promo/Code.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?php defined('SYSPATH') OR die('No direct script access.');

class Model_Promo_Code extends Kohana_Model_Promo_Code { }
class Model_Promo_Code extends Kohana_Model_Promo_Code { }
2 changes: 1 addition & 1 deletion classes/Model/Promotion.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?php defined('SYSPATH') OR die('No direct script access.');

class Model_Promotion extends Kohana_Model_Promotion { }
class Model_Promotion extends Kohana_Model_Promotion { }
2 changes: 1 addition & 1 deletion classes/Model/Promotion/Promocode.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?php defined('SYSPATH') OR die('No direct script access.');

class Model_Promotion_Promocode extends Kohana_Model_Promotion_Promocode { }
class Model_Promotion_Promocode extends Kohana_Model_Promotion_Promocode { }
2 changes: 1 addition & 1 deletion classes/Model/Promotion/Promocode/Giftcard.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?php defined('SYSPATH') OR die('No direct script access.');

class Model_Promotion_Promocode_Giftcard extends Kohana_Model_Promotion_Promocode_Giftcard { }
class Model_Promotion_Promocode_Giftcard extends Kohana_Model_Promotion_Promocode_Giftcard { }
2 changes: 1 addition & 1 deletion classes/Model/Promotion/Promocode/Percent.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?php defined('SYSPATH') OR die('No direct script access.');

class Model_Promotion_Promocode_Percent extends Kohana_Model_Promotion_Promocode_Percent { }
class Model_Promotion_Promocode_Percent extends Kohana_Model_Promotion_Promocode_Percent { }
9 changes: 2 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,13 @@
"require": {
"php": ">=5.3.0",
"composer/installers": "*",
"openbuildings/purchases": "~0.8.0",
"openbuildings/shipping": ">=0.8.0,<0.10.0"
"openbuildings/purchases": "^0.9.0",
"openbuildings/shipping": "^0.10.0"
},
"require-dev": {
"openbuildings/kohana-test-bootsrap": "0.1.*"
},
"autoload": {
"psr-0": {"Openbuildings\\Promotions\\": "src/"}
},
"extra": {
"branch-alias": {
"dev-master": "0.6.x-dev"
}
}
}
Loading

0 comments on commit bc552ee

Please sign in to comment.