/**
* @Then /^"([^"]*)" tablosunda aşağıdaki kayıtlar bulunmalı:$/
*/
public function tablosundaAsagidakiKayitlarBulunmali($arg1, \Behat\Gherkin\Node\TableNode $table)
{
$columns = implode(',', array_keys($table->getHash()[0]));
$sql = 'SELECT ' . $columns . ' FROM ' . $arg1;
$rows = $this->getDi()->getMySQLConnection()->fetchAll($sql);
assertEquals(count($rows), count($table->getHash()));
foreach ($rows as $index => $row) {
foreach ($row as $key => $value) {
$expectedValue = $table->getHash()[$index][$key];
if (strpos($expectedValue, 'REGEX=') > -1) {
$regexPattern = str_replace('REGEX=', '', $expectedValue);
$regexPattern = '#' . $regexPattern . '#';
assertRegExp($regexPattern, $value);
} else {
assertEquals($expectedValue, $value);
}
}
}
}