mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-16 06:51:27 +00:00
34 lines
614 B
PHP
34 lines
614 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Tests;
|
|
|
|
use GildedRose\Item;
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
class ItemTest extends TestCase
|
|
{
|
|
/**
|
|
* @group Item
|
|
*/
|
|
public function testItemCanBeCreated(): void
|
|
{
|
|
$item = new Item('foo', 1, 2);
|
|
|
|
$this->assertSame('foo', $item->name);
|
|
$this->assertSame(1, $item->sell_in);
|
|
$this->assertSame(2, $item->quality);
|
|
}
|
|
|
|
/**
|
|
* @group Item
|
|
*/
|
|
public function testItemToStringIsCorrect(): void
|
|
{
|
|
$item = new Item('foo', 1, 2);
|
|
|
|
$this->assertSame('foo, 1, 2', (string) $item);
|
|
}
|
|
}
|