fixed errors after cleaning up tests. removed some tabs
This commit is contained in:
parent
e360684d1b
commit
f943213f2c
14
models/Location.php
Normal file
14
models/Location.php
Normal file
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
class Location extends Doctrine_Record
|
||||
{
|
||||
public function setTableDefinition()
|
||||
{
|
||||
$this->hasColumn('lat', 'double', 10, array ());
|
||||
$this->hasColumn('lon', 'double', 10, array ());
|
||||
}
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
$this->hasMany('LocationI18n as LocationI18n', array('local' => 'id', 'foreign' => 'id'));
|
||||
}
|
||||
}
|
17
models/MysqlIndexTestRecord.php
Normal file
17
models/MysqlIndexTestRecord.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
class MysqlIndexTestRecord extends Doctrine_Record
|
||||
{
|
||||
public function setTableDefinition()
|
||||
{
|
||||
$this->hasColumn('name', 'string', null);
|
||||
$this->hasColumn('code', 'integer', 4);
|
||||
$this->hasColumn('content', 'string', 4000);
|
||||
|
||||
$this->index('content', array('fields' => 'content', 'type' => 'fulltext'));
|
||||
$this->index('namecode', array('fields' => array('name', 'code'),
|
||||
'type' => 'unique'));
|
||||
|
||||
$this->option('type', 'MYISAM');
|
||||
|
||||
}
|
||||
}
|
19
models/mmrUser_C.php
Normal file
19
models/mmrUser_C.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
class mmrUser_C extends Doctrine_Record
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->hasMany('mmrGroup_C as Group', array('local' => 'user_id',
|
||||
'foreign' => 'group_id',
|
||||
'refClass' => 'mmrGroupUser_C'));
|
||||
|
||||
}
|
||||
|
||||
public function setTableDefinition()
|
||||
{
|
||||
// Works when
|
||||
$this->hasColumn('u_id as id', 'string', 30, array('primary' => true));
|
||||
$this->hasColumn('name', 'string', 30);
|
||||
}
|
||||
}
|
||||
|
@ -79,7 +79,8 @@ class Doctrine_Export_Pgsql_TestCase extends Doctrine_UnitTestCase
|
||||
}
|
||||
public function testExportSql()
|
||||
{
|
||||
$sql = $this->export->exportSql(dirname(__FILE__) . DIRECTORY_SEPARATOR . '_files');
|
||||
$sql = $this->export->exportClassesSql(array("FooRecord", "FooReferenceRecord", "FooLocallyOwned", "FooForeignlyOwned", "FooBarRecord", "BarRecord"));
|
||||
//dirname(__FILE__) . DIRECTORY_SEPARATOR . '_files');
|
||||
|
||||
$this->assertEqual($sql, array ( 0 => 'CREATE TABLE foo_reference (foo1 BIGINT, foo2 BIGINT, PRIMARY KEY(foo1, foo2))',
|
||||
1 => 'CREATE TABLE foo_locally_owned (id BIGSERIAL, name VARCHAR(200), PRIMARY KEY(id))',
|
||||
|
@ -18,19 +18,18 @@ class GroupTest extends UnitTestCase
|
||||
{
|
||||
|
||||
$reporter->paintHeader();
|
||||
foreach ($this->_testCases as $k => $testCase) {
|
||||
$testCase->run();
|
||||
|
||||
$this->_passed += $testCase->getPassCount();
|
||||
$this->_failed += $testCase->getFailCount();
|
||||
foreach ($this->_testCases as $k => $testCase) {
|
||||
$testCase->run();
|
||||
$this->_passed += $testCase->getPassCount();
|
||||
$this->_failed += $testCase->getFailCount();
|
||||
$this->_messages = array_merge($this->_messages, $testCase->getMessages());
|
||||
|
||||
$this->_testCases[$k] = null;
|
||||
$this->_testCases[$k] = null;
|
||||
if(PHP_SAPI === "cli"){
|
||||
echo ".";
|
||||
}
|
||||
set_time_limit(900);
|
||||
}
|
||||
}
|
||||
$reporter->setTestCase($this);
|
||||
|
||||
$reporter->paintFooter();
|
||||
|
@ -366,9 +366,9 @@ class CliReporter extends HtmlReporter{
|
||||
}
|
||||
public function paintFooter(){
|
||||
echo "\n";
|
||||
foreach ($this->_test->getMessages() as $message) {
|
||||
print $message . "\n";
|
||||
}
|
||||
foreach ($this->_test->getMessages() as $message) {
|
||||
print $message . "\n";
|
||||
}
|
||||
echo "====================\n";
|
||||
print "Tested: " . $this->_test->getTestCaseCount() . ' test cases' ."\n";
|
||||
print "Successes: " . $this->_test->getPassCount() . " passes. \n";
|
||||
@ -397,19 +397,19 @@ class MyReporter extends HtmlReporter {
|
||||
public function paintFooter()
|
||||
{
|
||||
|
||||
print "<pre>";
|
||||
foreach ($this->_test->getMessages() as $message) {
|
||||
print $message . "\n";
|
||||
}
|
||||
print "</pre>";
|
||||
print "<pre>";
|
||||
foreach ($this->_test->getMessages() as $message) {
|
||||
print $message . "\n";
|
||||
}
|
||||
print "</pre>";
|
||||
$colour = ($this->_test->getFailCount() > 0 ? "red" : "green");
|
||||
print "<div style=\"";
|
||||
print "padding: 8px; margin-top: 1em; background-color: $colour; color: white;";
|
||||
print "\">";
|
||||
print $this->_test->getTestCaseCount() . ' test cases';
|
||||
print " test cases complete:\n";
|
||||
print "<strong>" . $this->_test->getPassCount() . "</strong> passes, ";
|
||||
print "<strong>" . $this->_test->getFailCount() . "</strong> fails and ";
|
||||
print "<strong>" . $this->_test->getPassCount() . "</strong> passes and ";
|
||||
print "<strong>" . $this->_test->getFailCount() . "</strong> fails.";
|
||||
print "</div>\n";
|
||||
}
|
||||
}
|
||||
@ -434,4 +434,3 @@ if (isset($argv[1]) && $argv[1] == "coverage") {
|
||||
} else {
|
||||
$test->run($reporter);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user