この問題はPDOで発生し続けますが、テストでこのエラーが発生します。
<?php
require_once('simpletest/unit_tester.php');
require_once('simpletest/reporter.php');
require_once('../model.php');
class TestOfCallMapper extends UnitTestCase {
function testOfReturnsAll() {
}
function setUp() {
R::setup("mysql:host=localhost;dbname=poo", root, '');
$this->destroySchema();
$this->createSchema();
}
function tearDown() {
$this->destroySchema();
}
private function createSchema() {
R::exec(file_get_contents('../database/create_schema.sql'));
}
private function destroySchema() {
R::exec(file_get_contents('../database/destroy_schema.sql'));
}
}
$test = new TestOfCallMapper('Test of CallMapper Methods');
$test->run(new HTMLReporter());
何が起こっているのかは、create_schemaファイルの内容が実行を継続し、クエリがバッファリングされていないことを示しているため、他のクエリの実行をブロックしていることです。PDOの使用をやめたのは、これが意味をなさなかったためで、Redbeanと呼ばれる別のORMを使い始めました。残念ながら、この苛立たしいエラーが再び発生し、RedbeanがPDOの上にあるように見えるため、修正できないようです。PDOを使用したときに、バッファリングされたクエリをオンにするオプションを設定しようとしましたが、機能しませんでした。私のテスト以外では、この方法はうまく機能しているようですが、それが受け入れられるかどうかはわかりません。