for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
class correiosTest extends PHPUnit_Framework_TestCase {
/**
* Testa o construtor da classe
*/
public function testConstructClass()
{
$this->assertInstanceOf('correios', new correios);
}
public function testGetContent()
$correios = new correios();
$this->assertContains('submitcarrinho_correios', $correios->getContent());
public function testGetOrderShippingCostSEDEXHoje()
$this->testGetOrderShppingCost("4", 10, 35.600000000000001);
public function testGetOrderShippingCostSEDEX10()
$this->testGetOrderShppingCost("3", 10, 30.100000000000001);
public function testGetOrderShippingCostSEDEX()
$this->testGetOrderShppingCost("2", 10, 21.199999999999999);
public function testGetOrderShppingCost($id_carrier = "1", $shipping_cost = 10, $expected_value = 19.8)
$correios->id_carrier = $id_carrier;
$params = new Params();
$frete = $correios->getOrderShippingCost($params, $shipping_cost);
$params
object<Params>
object<type>
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example:
function acceptsInteger($int) { } $x = '123'; // string "123" // Instead of acceptsInteger($x); // we recommend to use acceptsInteger((integer) $x);
$shipping_cost
integer
$this->assertEquals($shipping_cost + $expected_value, $frete);
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: