Ejemplo n.º 1
0
<?php

require_once dirname(__FILE__) . '/../bootstrap/unit.php';
require_once dirname(__FILE__) . '/../../lib/sfDynamics.class.php';
$testCount = 1;
class ManagerMock extends sfDynamicsManager
{
}
$t = new lime_test($testCount, new lime_output_color());
$t->comment('::getManager()');
if (!sfContext::hasInstance()) {
    require_once $_SERVER['SYMFONY'] . '/autoload/sfCoreAutoload.class.php';
    sfCoreAutoload::register();
    require_once dirname(__FILE__) . '/../fixtures/project/config/ProjectConfiguration.class.php';
    sfContext::createInstance(ProjectConfiguration::getApplicationConfiguration('frontend', 'test', isset($debug) ? $debug : true));
    if (!sfContext::hasInstance()) {
        $t->error('A context instance is required');
        die;
    }
    $t->info('A frontend context has been initialized for tests');
}
sfConfig::set('app_sfDynamicsPlugin_manager', 'ManagerMock');
$t->isa_ok(sfDynamics::getManager(), 'ManagerMock', '::getManager() the manager class can be customized in app.yml');
    {
        return '<link rel="stylesheet" type="text/css" media="screen" href="/dynamics/foo.css" />';
    }
    public function generateJsHtml()
    {
        return '<script type="text/javascript" src="/dynamics/foo.js"></script>';
    }
}
$t = new lime_test(7, new lime_output_color());
if (!sfContext::hasInstance()) {
    require_once $_SERVER['SYMFONY'] . '/autoload/sfCoreAutoload.class.php';
    sfCoreAutoload::register();
    require_once dirname(__FILE__) . '/../../fixtures/project/config/ProjectConfiguration.class.php';
    sfContext::createInstance(ProjectConfiguration::getApplicationConfiguration('frontend', 'test', isset($debug) ? $debug : true));
    if (!sfContext::hasInstance()) {
        $t->error('A context instance is required');
        die;
    }
    $t->info('A frontend context has been initialized for tests');
}
$t->comment('->addSfDynamicsTags()');
sfConfig::set('app_sfDynamicsPlugin_manager', 'ManagerMock');
$manager = sfDynamics::getManager();
$t->info('New placeholder system');
$content = <<<END
<html>
  <head>
    <!-- Include sfDynamics css tags -->
    <link rel="stylesheet" type="text/css" media="screen" href="/bar.css" />
  </head>
  <body>