-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
276 additions
and
37 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
18 changes: 18 additions & 0 deletions
18
tests/PhpUnitsOfMeasureTest/PhysicalQuantity/AccelerationTest.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,18 @@ | ||
<?php | ||
|
||
namespace PhpUnitsOfMeasureTest\PhysicalQuantity; | ||
|
||
use PhpUnitsOfMeasure\PhysicalQuantity\Acceleration; | ||
|
||
class AccelerationTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
/** | ||
* Verify that the object instantiates without error. | ||
* | ||
* @covers \PhpUnitsOfMeasure\PhysicalQuantity\Acceleration::__construct() | ||
*/ | ||
public function testConstructorSucceeds() | ||
{ | ||
$target = new Acceleration(1, 'm/s^2'); | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
namespace PhpUnitsOfMeasureTest\PhysicalQuantity; | ||
|
||
use PhpUnitsOfMeasure\PhysicalQuantity\Area; | ||
use PHPUnit_Framework_TestCase; | ||
|
||
class AreaTest extends PHPUnit_Framework_TestCase | ||
{ | ||
/** | ||
* Verify that the object instantiates without error. | ||
* | ||
* @covers \PhpUnitsOfMeasure\PhysicalQuantity\Area::__construct() | ||
*/ | ||
public function testConstructorSucceeds() | ||
{ | ||
$target = new Area(1, 'm^2'); | ||
} | ||
|
||
public function testToHectares() | ||
{ | ||
$area = new Area(3, 'ha'); | ||
|
||
$this->assertEquals(30000, $area->toUnit("m^2")); | ||
} | ||
|
||
/** | ||
* There aren't lots of super nice conversions between ac -> m^2, | ||
* so we'll check that it's close. | ||
* | ||
* @return [type] [description] | ||
*/ | ||
public function testToAcres() | ||
{ | ||
$area = new Area(13, 'ac'); | ||
|
||
$area = round($area->toUnit("m^2"), 6); | ||
|
||
$this->assertEquals(52609.133491, $area); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
tests/PhpUnitsOfMeasureTest/PhysicalQuantity/ElectricCurrentTest.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,18 @@ | ||
<?php | ||
|
||
namespace PhpUnitsOfMeasureTest\PhysicalQuantity; | ||
|
||
use PhpUnitsOfMeasure\PhysicalQuantity\ElectricCurrent; | ||
|
||
class ElectricCurrentTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
/** | ||
* Verify that the object instantiates without error. | ||
* | ||
* @covers \PhpUnitsOfMeasure\PhysicalQuantity\ElectricCurrent::__construct() | ||
*/ | ||
public function testConstructorSucceeds() | ||
{ | ||
$target = new ElectricCurrent(1, 'A'); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
tests/PhpUnitsOfMeasureTest/PhysicalQuantity/LengthTest.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,18 @@ | ||
<?php | ||
|
||
namespace PhpUnitsOfMeasureTest\PhysicalQuantity; | ||
|
||
use PhpUnitsOfMeasure\PhysicalQuantity\Length; | ||
|
||
class LengthTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
/** | ||
* Verify that the object instantiates without error. | ||
* | ||
* @covers \PhpUnitsOfMeasure\PhysicalQuantity\Length::__construct() | ||
*/ | ||
public function testConstructorSucceeds() | ||
{ | ||
$target = new Length(1, 'm'); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
tests/PhpUnitsOfMeasureTest/PhysicalQuantity/LuminousIntensityTest.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,18 @@ | ||
<?php | ||
|
||
namespace PhpUnitsOfMeasureTest\PhysicalQuantity; | ||
|
||
use PhpUnitsOfMeasure\PhysicalQuantity\LuminousIntensity; | ||
|
||
class LuminousIntensityTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
/** | ||
* Verify that the object instantiates without error. | ||
* | ||
* @covers \PhpUnitsOfMeasure\PhysicalQuantity\LuminousIntensity::__construct() | ||
*/ | ||
public function testConstructorSucceeds() | ||
{ | ||
$target = new LuminousIntensity(1, 'cd'); | ||
} | ||
} |
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,18 @@ | ||
<?php | ||
|
||
namespace PhpUnitsOfMeasureTest\PhysicalQuantity; | ||
|
||
use PhpUnitsOfMeasure\PhysicalQuantity\Mass; | ||
|
||
class MassTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
/** | ||
* Verify that the object instantiates without error. | ||
* | ||
* @covers \PhpUnitsOfMeasure\PhysicalQuantity\Mass::__construct() | ||
*/ | ||
public function testConstructorSucceeds() | ||
{ | ||
$target = new Mass(1, 'kg'); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
tests/PhpUnitsOfMeasureTest/PhysicalQuantity/PressureTest.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,18 @@ | ||
<?php | ||
|
||
namespace PhpUnitsOfMeasureTest\PhysicalQuantity; | ||
|
||
use PhpUnitsOfMeasure\PhysicalQuantity\Pressure; | ||
|
||
class PressureTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
/** | ||
* Verify that the object instantiates without error. | ||
* | ||
* @covers \PhpUnitsOfMeasure\PhysicalQuantity\Pressure::__construct() | ||
*/ | ||
public function testConstructorSucceeds() | ||
{ | ||
$target = new Pressure(1, 'Pa'); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
tests/PhpUnitsOfMeasureTest/PhysicalQuantity/TemperatureTest.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,18 @@ | ||
<?php | ||
|
||
namespace PhpUnitsOfMeasureTest\PhysicalQuantity; | ||
|
||
use PhpUnitsOfMeasure\PhysicalQuantity\Temperature; | ||
|
||
class TemperatureTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
/** | ||
* Verify that the object instantiates without error. | ||
* | ||
* @covers \PhpUnitsOfMeasure\PhysicalQuantity\Temperature::__construct() | ||
*/ | ||
public function testConstructorSucceeds() | ||
{ | ||
$target = new Temperature(1, 'K'); | ||
} | ||
} |
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
Oops, something went wrong.