add missing files for forked idiorm

This commit is contained in:
Andrew Dolgov
2022-07-16 16:30:46 +03:00
parent fdd1c43612
commit b8c1d622a7
187 changed files with 11950 additions and 45862 deletions
+36
View File
@@ -0,0 +1,36 @@
<?php
class ConfigTest53 extends PHPUnit_Framework_TestCase {
public function setUp() {
// Enable logging
ORM::configure('logging', true);
// Set up the dummy database connection
$db = new MockPDO('sqlite::memory:');
ORM::set_db($db);
ORM::configure('id_column', 'primary_key');
}
public function tearDown() {
ORM::configure('logging', false);
ORM::set_db(null);
ORM::configure('id_column', 'id');
}
public function testLoggerCallback() {
ORM::configure('logger', function($log_string) {
return $log_string;
});
$function = ORM::get_config('logger');
$this->assertTrue(is_callable($function));
$log_string = "UPDATE `widget` SET `added` = NOW() WHERE `id` = '1'";
$this->assertEquals($log_string, $function($log_string));
ORM::configure('logger', null);
}
}