diff --git a/dev/tests/integration/testsuite/Magento/Sales/Block/Adminhtml/Order/Create/Form/AddressTest.php b/dev/tests/integration/testsuite/Magento/Sales/Block/Adminhtml/Order/Create/Form/AddressTest.php index 00f7512dd7f13..0ebf3fbae055c 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/Block/Adminhtml/Order/Create/Form/AddressTest.php +++ b/dev/tests/integration/testsuite/Magento/Sales/Block/Adminhtml/Order/Create/Form/AddressTest.php @@ -21,6 +21,18 @@ class AddressTest extends \PHPUnit_Framework_TestCase /** @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Customer\Api\AddressRepositoryInterface */ protected $addressRepository; + /** + * @return int + */ + private function getNumberOfCountryOptions() + { + /** @var \Magento\Directory\Model\ResourceModel\Country\Collection $countryCollection */ + $countryCollection = $this->_objectManager->create( + \Magento\Directory\Model\ResourceModel\Country\Collection::class + ); + return count($countryCollection->toOptionArray()); + } + protected function setUp() { $this->_objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); @@ -182,7 +194,7 @@ public function testGetForm() /** @var \Magento\Framework\Data\Form\Element\Select $countryIdField */ $countryIdField = $fieldset->getElements()->searchById('country_id'); - $this->assertSelectCount('option', 246, $countryIdField->getElementHtml()); + $this->assertSelectCount('option', $this->getNumberOfCountryOptions(), $countryIdField->getElementHtml()); } /**