<?php array_search(mixed $needle, array $haystack, bool $strict = false): int|string|false
<?php $invoice = Invoice::factory()->make(); $invoice->setTransmissionFailure(TransmissionFailure::ERP_CONNECTION_FAILURE); $expectedTransmissionFailureIndex = array_search('transmissionFailure', $invoice->getExpectedOrder()); $actualTransmissionFailureIndex = array_search('transmissionFailure', array_keys($invoice->sortedAttributes())); $this->assertNotFalse($expectedTransmissionFailureIndex);
<?php $invoice->setTransmissionFailure(TransmissionFailure::ERP_CONNECTION_FAILURE); $expectedTransmissionFailureIndex = array_search('transmissionFailure', $invoice->getExpectedOrder()); $actualTransmissionFailureIndex = array_search('transmissionFailure', array_keys($invoice->sortedAttributes())); $this->assertNotFalse($expectedTransmissionFailureIndex); $this->assertNotFalse($actualTransmissionFailureIndex);