<?php
use App\Product;
class ProductTest extends PHPUnit_Framework_TestCase
{
function testAProductHasName()
{
$product = new Product('Fallout 4');
$this->assertEquals('Fallout 4', $product->name());
}
function testAProductionHasACost()
{
$product = new Product('Fallout 4', 59);
$this->assertEquals(59, product->cost());
}
}
<?php
namespace App;
class Product
{
producted $name;
public function_construct($name)
{
$this->name = $name;
}
public function name()
{
return $this->name;
}
}