Coupon : Add unit test for coupon removing X Amount & X Percent

This commit is contained in:
gmorel
2013-11-25 22:58:19 +01:00
parent 67a38bca20
commit d0ccfc732a
4 changed files with 7 additions and 67 deletions

View File

@@ -1,53 +0,0 @@
<?php
/**********************************************************************************/
/* */
/* Thelia */
/* */
/* Copyright (c) OpenStudio */
/* email : info@thelia.net */
/* web : http://www.thelia.net */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 3 of the License */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* */
/**********************************************************************************/
namespace Thelia\Coupon;
use Thelia\Condition\ConditionOrganizer;
/**
* Created by JetBrains PhpStorm.
* Date: 8/19/13
* Time: 3:24 PM
*
* Unit Test ConditionOrganizer Class
* Generated by PHPUnit_SkeletonGenerator 1.2.1 on 2013-11-17 at 18:59:24.
*
* @package Condition
* @author Guillaume MOREL <gmorel@openstudio.fr>
*
*/
class ConditionOrganizerTest extends \PHPUnit_Framework_TestCase
{
/**
* @covers Thelia\Coupon\RuleOrganizer::organize
* @todo Implement testOrganize().
*/
public function testOrganize()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
}
}

View File

@@ -605,7 +605,7 @@ class MatchForTotalAmountTest extends \PHPUnit_Framework_TestCase
/**
* Check unknown currency
*
* @covers Thelia\Condition\ConditionAbstract::isCurrencyValid
* @covers Thelia\Condition\Implementation\ConditionAbstract::isCurrencyValid
* @expectedException \Thelia\Exception\InvalidConditionValueException
*
*/
@@ -672,7 +672,7 @@ class MatchForTotalAmountTest extends \PHPUnit_Framework_TestCase
/**
* Check invalid currency
*
* @covers Thelia\Condition\ConditionAbstract::isPriceValid
* @covers Thelia\Condition\Implementation\ConditionAbstract::isPriceValid
* @expectedException \Thelia\Exception\InvalidConditionValueException
*
*/
@@ -739,7 +739,7 @@ class MatchForTotalAmountTest extends \PHPUnit_Framework_TestCase
/**
* Check invalid currency
*
* @covers Thelia\Condition\ConditionAbstract::isPriceValid
* @covers Thelia\Condition\Implementation\ConditionAbstract::isPriceValid
* @expectedException \Thelia\Exception\InvalidConditionValueException
*
*/

View File

@@ -169,6 +169,8 @@ class RemoveXAmountTest extends \PHPUnit_Framework_TestCase
$this->assertEquals(254, $coupon->getMaxUsage());
$this->assertEquals($date, $coupon->getExpirationDate());
$this->assertEquals(10.00, $coupon->exec());
}
/**

View File

@@ -101,6 +101,7 @@ class RemoveXPercentTest extends \PHPUnit_Framework_TestCase
/**
* @covers Thelia\Coupon\Type\RemoveXPercent::set
* @covers Thelia\Coupon\Type\RemoveXPercent::exec
*/
public function testSet()
{
@@ -158,18 +159,8 @@ class RemoveXPercentTest extends \PHPUnit_Framework_TestCase
$this->assertEquals(254, $coupon->getMaxUsage());
$this->assertEquals($date, $coupon->getExpirationDate());
}
/**
* @covers Thelia\Coupon\Type\RemoveXPercent::exec
* @todo Implement testExec().
*/
public function testExec()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
$this->assertEquals(40.00, $coupon->exec());
}
/**