<?php /** * Copyright (c) 2019 TechDivision GmbH * All rights reserved * * This product includes proprietary software developed at TechDivision GmbH, Germany * For more information see http://www.techdivision.com/ * * To obtain a valid license for using this software please contact us at * license@techdivision.com */ declare(strict_types=1); namespace Met\ExampleMagento2ModuleTesting\Test\Integration\Model; use Magento\Framework\Api\SearchCriteriaBuilder; use Magento\Sales\Api\OrderRepositoryInterface; use Magento\TestFramework\Helper\Bootstrap; use PHPUnit\Framework\TestCase; /** * @copyright Copyright (c) 2019 TechDivision GmbH (http://www.techdivision.com) * @link http://www.techdivision.com/ * @author Vadim Justus <v.justus@techdivision.com> */ class ExampleTest extends TestCase { /** * @magentoDataFixtures Met_ExampleMagento2ModuleTesting::Test/Integration/_files/some-fixture.php */ public function testSomething() { /** @var SearchCriteriaBuilder $searchCriteriaBuilder */ $searchCriteriaBuilder = Bootstrap::getObjectManager()->create(SearchCriteriaBuilder::class); /** @var OrderRepositoryInterface $orderRepository */ $orderRepository = Bootstrap::getObjectManager()->get(OrderRepositoryInterface::class); $searchCriteria = $searchCriteriaBuilder->create(); $orders = $orderRepository->getList($searchCriteria)->getItems(); $this->assertCount(6, $orders); } }