コード例 #1
0
ファイル: dmDoctrineGraphviz.php プロジェクト: theolymp/diem
 protected function getAllTables()
 {
     if (null === $this->tables) {
         $this->tables = dmProject::getAllModels();
         foreach ($this->tables as $table) {
             if (dmDb::table($table)->hasI18n()) {
                 new $table();
                 $this->tables[] = dmDb::table($table)->getI18nTable();
             }
         }
     }
     return $this->tables;
 }
コード例 #2
0
 protected function getUnchangedModels()
 {
     return array_diff(dmProject::getAllModels(), $this->getChangedModels());
 }
コード例 #3
0
ファイル: dmProjectTest.php プロジェクト: theolymp/diem
<?php

require_once realpath(dirname(__FILE__) . '/../../..') . '/unit/helper/dmModuleUnitTestHelper.php';
$helper = new dmModuleUnitTestHelper();
$helper->boot();
$t = new lime_test(10);
$models = dmProject::getModels();
$dmModels = dmProject::getDmModels();
$allModels = dmProject::getAllModels();
$t->is_deeply($models, $expected = array('DmTestCateg', 'DmTestComment', 'DmTestDomainCateg', 'DmTestDomain', 'DmTestFruit', 'DmTestPost', 'DmTestPostTag', 'DmTestTag', 'DmTestUser', 'DmContact', 'DmTag'), 'dmProject::getModels() -> ' . implode(', ', $expected));
$t->is_deeply(array_intersect($models, $allModels), $models, 'dmProject::getAllModels() contain all project models');
$t->is_deeply(array_intersect($dmModels, $allModels), $dmModels, 'dmProject::getAllModels() contain all Diem models');
$t->is_deeply(array_intersect($models, $dmModels), array(), 'dmProject::getDmModels() contain no project models');
$t->is_deeply(array_intersect($dmModels, $models), array(), 'dmProject::getModels() contain no Diem models');
$t->is(count($dmModels), $expected = 17, 'Diem has ' . $expected . ' models');
$t->is(dmProject::getKey(), 'project', 'project key is "project"');
$t->ok(dmProject::appExists('front'), 'project has a front app');
$t->ok(dmProject::appExists('admin'), 'project has a admin app');
$t->ok(!dmProject::appExists('bluk'), 'project has no bluk app');
コード例 #4
0
ファイル: dmTablePageTreeTest.php プロジェクト: theolymp/diem
<?php

require_once dirname(__FILE__) . '/helper/dmUnitTestHelper.php';
$helper = new dmUnitTestHelper();
$helper->boot('front');
$modules = $helper->getModuleManager()->getModules();
$t = new lime_test(count(dmProject::getAllModels()));
$t->diag('Table interaction with page tree');
foreach (dmProject::getAllModels() as $model) {
    $table = dmDb::table($model);
    if ($table instanceof dmDoctrineTable) {
        if ($module = $table->getDmModule()) {
            $interactsWithPageTree = $module->isProject();
        } else {
            $interactsWithPageTree = false;
            foreach ($table->getRelationHolder()->getLocals() as $localRelation) {
                if ($localModule = $helper->get('module_manager')->getModuleByModel($localRelation['class'])) {
                    if ($localModule->interactsWithPageTree()) {
                        $interactsWithPageTree = true;
                        break;
                    }
                }
            }
        }
        $t->is($table->interactsWithPageTree(), $interactsWithPageTree, get_class($table) . '->interactsWithPageTree() : ' . ($interactsWithPageTree ? 'YES' : 'NO'));
    }
}