This repository has been archived by the owner on Feb 3, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#34: Add new unit tests and remove unused tests
Adds new unit tests to test a few new areas of the code and removes unit tests that tested the previous logic. Some of these tests are already run on the royal mail library, and have been moved there.
- Loading branch information
Aaron Rickard
committed
Dec 22, 2015
1 parent
c8cb7c2
commit 1bfdcb2
Showing
10 changed files
with
108 additions
and
335 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
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 |
---|---|---|
@@ -1,11 +1,47 @@ | ||
<?php | ||
|
||
class Meanbee_Royalmail_Test_Helper_Data extends EcomDev_PHPUnit_Test_Case { | ||
class Meanbee_Royalmail_Test_Helper_Data extends EcomDev_PHPUnit_Test_Case | ||
{ | ||
|
||
private $_dataHelper; | ||
|
||
public function setUp() | ||
{ | ||
$this->_dataHelper = Mage::helper('royalmail'); | ||
} | ||
|
||
public function tearDown() | ||
{ | ||
$this->_dataHelper = null; | ||
} | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function testGetWeightKg() | ||
{ | ||
$this->_dataHelper->setWeightUnit('kg'); | ||
$this->_dataHelper->_setWeight(0.02); | ||
$this->assertEquals(20.0, Mage::helper('royalmail')->_getWeight()); | ||
} | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function testGetWeightG() | ||
{ | ||
$this->_dataHelper->setWeightUnit('g'); | ||
$this->_dataHelper->_setWeight(0.02); | ||
$this->assertEquals(0.02, Mage::helper('royalmail')->_getWeight()); | ||
} | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function testGetCountryWorldZone() { | ||
$this->assertEquals('wz2', Mage::helper('royalmail')->getWorldZone('TO')); | ||
public function testGetWeightlb() | ||
{ | ||
$this->_dataHelper->setWeightUnit('lb'); | ||
$this->_dataHelper->_setWeight(0.02); | ||
$this->assertEquals(9.0718474000000011, Mage::helper('royalmail')->_getWeight()); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
app/code/community/Meanbee/Royalmail/Test/Model/Parcelsize.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,13 @@ | ||
<?php | ||
class Meanbee_Royalmail_Test_Model_Parcelsize extends Meanbee_Royalmail_Test_Util_Sourcemodel { | ||
/** @var Meanbee_Royalmail_Model_Parcelsize */ | ||
protected $_model = null; | ||
|
||
public function setUp() { | ||
$this->_model = Mage::getModel('royalmail/parcelsize'); | ||
} | ||
|
||
public function tearDown() { | ||
$this->_model = null; | ||
} | ||
} |
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
167 changes: 0 additions & 167 deletions
167
app/code/community/Meanbee/Royalmail/Test/Model/Shipping/Carrier/Royalmail/Rules.php
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.