for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace App\Tests\Game\BlackJack;
use App\Cards\Card;
use App\Game\BlackJack\Dealer;
use PHPUnit\Framework\TestCase;
/**
* Test cases for class Dealer.
*/
class DealerTest extends TestCase
{
* testCreateObject
*
* Construct object and verify that the object has the expected
* properties, use no arguments.
* @return void
public function testCreateObject(): void
$dealer = new Dealer();
$this->assertInstanceOf(Dealer::class, $dealer);
}
* testPlay
* Test the Play function
public function testPlay(): void
$card = new Card('2', 'Spades');
$dealer->addCard($card);
while (true === $dealer->Play()) {
$handValue = $dealer->getHandValue();
$this->assertLessThan(17, $handValue);
$this->assertGreaterThan(16, $handValue);