Что такое assertions?

Ответ
// Основные assertions PHPUnit
$this->assertEquals($expected, $actual);      // ==
$this->assertSame($expected, $actual);         // ===
$this->assertTrue($value);
$this->assertFalse($value);
$this->assertNull($value);
$this->assertNotNull($value);
$this->assertCount(3, $array);
$this->assertContains('item', $array);
$this->assertArrayHasKey('key', $array);
$this->assertInstanceOf(User::class, $obj);
$this->assertStringContainsString('needle', $haystack);
$this->assertMatchesRegularExpression('/\d+/', $str);
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Invalid email');

// Pest expectations
expect($value)->toBe(42)
    ->toBeInstanceOf(User::class)
    ->toHaveCount(3);
🧠Квиз 🏆Лидеры 🎯Собесед. 📖Вопросы 📚База зн.