protected function assertBeforeInArray($element1, $element2, array $elements)
{
$position1 = array_search($element1, $elements, true);
$position2 = array_search($element2, $elements, true);
if ($position1 === false || $position2 === false) {
$this->fail('Element not found in list');
}
$this->assertLessThan($position2, $position1, 'Element order does not match');
}