for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace App\Tests\Entity;
use App\Entity\Product;
use PHPUnit\Framework\TestCase;
/**
* Test cases for the Product entity.
*/
class ProductTest extends TestCase
{
* Test set and get name.
public function testSetNameAndGetName(): void
$product = new Product();
$product->setName("Test Product");
$this->assertEquals("Test Product", $product->getName());
}
* Test set and get value.
public function testSetValueAndGetValue(): void
$product->setValue(38);
$this->assertEquals(38, $product->getValue());
* Test initial id is null.
public function testInitialIdIsNull(): void
$this->assertNull($product->getId());