10.April 2026
This commit is contained in:
parent
4a8f4b4abc
commit
396d049439
203 changed files with 18098 additions and 2911 deletions
37
tests/Unit/Services/ProductOrderContextTest.php
Normal file
37
tests/Unit/Services/ProductOrderContextTest.php
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
|
||||
use App\Models\Product;
|
||||
use App\Services\ProductOrderContext;
|
||||
use Tests\TestCase;
|
||||
|
||||
uses(TestCase::class);
|
||||
|
||||
it('erlaubt Kunden-Shop show_on 3 für ot-customer ohne Abo', function () {
|
||||
$product = new Product(['show_on' => ['3']]);
|
||||
|
||||
expect(ProductOrderContext::isProductAllowedInContext($product, false, 'ot-customer'))->toBeTrue();
|
||||
});
|
||||
|
||||
it('lehnt reine Abo show_on 12 für ot-customer ohne Abo ab', function () {
|
||||
$product = new Product(['show_on' => ['12']]);
|
||||
|
||||
expect(ProductOrderContext::isProductAllowedInContext($product, false, 'ot-customer'))->toBeFalse();
|
||||
});
|
||||
|
||||
it('erlaubt Abo-Produkte für abo-ot-customer', function () {
|
||||
$product = new Product(['show_on' => ['12']]);
|
||||
|
||||
expect(ProductOrderContext::isProductAllowedInContext($product, true, 'abo-ot-customer'))->toBeTrue();
|
||||
});
|
||||
|
||||
it('erlaubt Berater-Shop show_on 2 für me ohne Abo', function () {
|
||||
$product = new Product(['show_on' => ['2']]);
|
||||
|
||||
expect(ProductOrderContext::isProductAllowedInContext($product, false, 'me'))->toBeTrue();
|
||||
});
|
||||
|
||||
it('mapped customer webshop wie ot-customer ohne Abo', function () {
|
||||
$product = new Product(['show_on' => ['3']]);
|
||||
|
||||
expect(ProductOrderContext::isProductAllowedInCustomerWebshop($product))->toBeTrue();
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue