diff --git a/tests/Validation/ValidationTest.php b/tests/Validation/ValidationTest.php index 4c53cafb..46756b3e 100644 --- a/tests/Validation/ValidationTest.php +++ b/tests/Validation/ValidationTest.php @@ -3,10 +3,6 @@ namespace Cone\Bazar\Tests\Validation; use Cone\Bazar\Models\Order; -use Cone\Bazar\Models\Product; -use Cone\Bazar\Models\Property; -use Cone\Bazar\Models\Variant; -use Cone\Bazar\Rules\Option; use Cone\Bazar\Rules\TransactionAmount; use Cone\Bazar\Rules\Vat; use Cone\Bazar\Tests\TestCase; @@ -43,37 +39,4 @@ public function test_validator_validates_transaction_amounts(): void $v = new Validator($this->translator, ['amount' => 10000], ['amount' => [new TransactionAmount($order)]]); $this->assertFalse($v->passes()); } - - public function test_validator_validates_variant_options(): void - { - $property = Property::factory()->create(['name' => 'Material', 'slug' => 'material']); - $property->values()->create(['name' => 'Gold', 'value' => 'gold']); - - $product = Product::factory()->create(); - $product->propertyValues()->attach($property->values); - - $variant = $product->variants()->save(Variant::factory()->make()); - $variant->propertyValues()->attach($property->values); - - $v = new Validator( - $this->translator, - ['variation' => ['material' => 'silver']], - ['variation' => [new Option($product)]] - ); - $this->assertTrue($v->passes()); - - $v = new Validator( - $this->translator, - ['variation' => ['material' => 'gold']], - ['variation' => [new Option($product)]] - ); - $this->assertFalse($v->passes()); - - $v = new Validator( - $this->translator, - ['variation' => ['material' => 'gold']], - ['variation' => [new Option($product, $variant)]] - ); - $this->assertTrue($v->passes()); - } }