tddwizard / magento2-fixtures

Fixture library for Magento 2 integration tests by @schmengler (@integer-net)
http://tddwizard.com/
MIT License
143 stars 28 forks source link

PlaceOrder Fixture With Quote/Product/Customer broken in Magento 2.2.2 #11

Closed NoorulBhoelai closed 6 years ago

NoorulBhoelai commented 6 years ago

Fixture used:

$objectManager   = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
$customerFixture = new \TddWizard\Fixtures\Customer\CustomerFixture(
    \TddWizard\Fixtures\Customer\CustomerBuilder::aCustomer()
        ->withAddresses(
            \TddWizard\Fixtures\Customer\AddressBuilder::anAddress()
                ->asDefaultBilling()->asDefaultShipping()
        )
        ->build()
);
$product         = \TddWizard\Fixtures\Catalog\ProductBuilder::aSimpleProduct()
    ->withIsInStock(true)
    ->withStockQty(10)
    ->withPrice(100)
    ->build();
$productFixture = new \TddWizard\Fixtures\Catalog\ProductFixture(
    $product
);
$customerFixture->login();
$checkout = \TddWizard\Fixtures\Checkout\CustomerCheckout::fromCart(
    \TddWizard\Fixtures\Checkout\CartBuilder::forCurrentSession()
        ->withSimpleProduct(
            $productFixture->getSku()
        )
        ->build()
);
$checkout->placeOrder();
NoorulBhoelai commented 6 years ago

It was a bug in another module, some bad configuration etc/config.xml.