You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<?php
// Product.php
namespace App;
class Product
{
public function __construct(
public string $name,
public float $price,
public int $stock
) {}
public function isInStock(): bool
{
return $this->stock > 0;
}
}
// tests/ProductTest.php
namespace Tests;
use App\Product;
test('product shows correct stock status', function () {
$inStock = new Product('In Stock', 100, 5);
// $outOfStock = new Product('Out of Stock', 100, 0);
expect($inStock->isInStock())->toBeTrue();
// This assertion is commented out but mutation testing still shows 100% coverage
// expect($outOfStock->isInStock())->toBeFalse();
});
How to Reproduce
Running ./vendor/bin/pest --mutate doesn't return the case of a product with no stock and reaches 100% mutation score without the
expect($outOfStock->isInStock())->toBeFalse(); expectation
Sample Repository
No response
Pest Version
3.7.1
PHP Version
8.3
Operation System
macOS
Notes
No response
The text was updated successfully, but these errors were encountered:
What Happened
I think I don't fully understand this but given
How to Reproduce
Running ./vendor/bin/pest --mutate doesn't return the case of a product with no stock and reaches 100% mutation score without the
expect($outOfStock->isInStock())->toBeFalse(); expectation
Sample Repository
No response
Pest Version
3.7.1
PHP Version
8.3
Operation System
macOS
Notes
No response
The text was updated successfully, but these errors were encountered: