~s', $this->data, $matches); if ($match !== 1) { return 'unable to match row'; } $rowData = $matches[0]; // extract cell into $matches $match = preg_match('~Sep<', 'table style for header row cell J1'], ['J2', 'background-color:#C0E4F5;">110<', 'table style for cell J2'], ['I3', 'background-color:#82CAEB;">70<', 'table style for cell I3'], ['J3', 'background-color:#B7E1CD;">70<', 'conditional style for cell J3'], // as conditional calculations are on ['K3', 'background-color:#82CAEB;">70<', 'table style for cell K3'], ['J4', 'background-color:#C0E4F5;">1<', 'table style for cell J4'], ['J5', 'background-color:#82CAEB;">1<', 'table style for cell J5'], ]; foreach ($expectedMatches as $expected) { [$coordinate, $expectedString, $message] = $expected; $string = $this->extractCell($coordinate); self::assertStringContainsString($expectedString, $string, $message); } } }