/**
 *
 * Copyright (c) 2007 Yahoo! Inc.  All rights reserved.
 * The copyrights embodied in the content in this file are licensed
 * under the MIT open source license.
 *
 * For the full copyright and license information, please view the LICENSE.yahoo
 * file that was distributed with this source code.
 */
$sf_symfony_lib_dir = '/Users/dustin/projects/symfony/branch/1.1/lib';
$sf_root_dir = realpath(dirname(__FILE__) . '/../../fixtures/project');
require_once $sf_root_dir . '/config/ProjectConfiguration.class.php';
$configuration = new ProjectConfiguration($sf_root_dir);
// load lime
require_once $configuration->getSymfonyLibDir() . '/vendor/lime/lime.php';
$t = new lime_test(2, new lime_output_color());
require_once dirname(__FILE__) . '/../../../lib/util/ysfCartesianIterator.class.php';
$test = array();
// test data
$data1 = array('symfony', 'dimensions');
$data2 = array('works', 'properly');
$cartestianExpression = new ysfCartesianIterator();
$cartestianExpression->addArray($data1);
$cartestianExpression->addArray($data2);
foreach ($cartestianExpression as $catesianProduct) {
    array_push($test, $catesianProduct);
}
$t->is($cartestianExpression instanceof Iterator, 'true', 'is subclass of Iterator');
$t->diag('->addArray()');
$t->is($test, array(array('symfony', 'works'), array('dimensions', 'works'), array('symfony', 'properly'), array('dimensions', 'properly')), 'cartestian expression is expanded correctly');
Пример #2
0
<?php

$_test_dir = realpath(dirname(__FILE__) . '/..');
$_root_dir = realpath(file_exists($_test_dir . '/../symfony') ? $_test_dir . '/..' : $_test_dir . '/../../..');
if (false !== strpos(file_get_contents($_root_dir . '/symfony'), 'ProjectConfiguration')) {
    // symfony 1.1 bootstrap
    require_once $_root_dir . '/config/ProjectConfiguration.class.php';
    $configuration = new ProjectConfiguration($_root_dir);
    $sf_symfony_lib_dir = $configuration->getSymfonyLibDir();
} else {
    // symfony 1.0 bootstrap
    define('SF_ROOT_DIR', $_root_dir);
    include SF_ROOT_DIR . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'config.php';
}
require_once $sf_symfony_lib_dir . '/vendor/lime/lime.php';
$ga_lib_dir = $_root_dir . '/plugins/sfGoogleAnalyticsPlugin/lib';
Пример #3
0
<?php

/*
 * This file is part of the sfPHPUnit2Plugin package.
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 *
 * Idea taken from bootstrap/unit.php of the lime bootstrap file
 */
$_test_dir = realpath(dirname(__FILE__) . '/../..');
$_root_dir = $_test_dir . '/..';
// configuration
require_once $_root_dir . '/config/ProjectConfiguration.class.php';
$configuration = new ProjectConfiguration($_root_dir);
// lime
include $configuration->getSymfonyLibDir() . '/vendor/lime/lime.php';
//custom base class
require_once dirname(__FILE__) . '/../lib/BaseUnitTestCase.class.php';
// autoloader for sfPHPUnit2Plugin libs
$autoload = sfSimpleAutoload::getInstance();
$autoload->addDirectory($_root_dir . '/plugins/sfPHPUnit2Plugin/lib/config');
$autoload->register();
Пример #4
0
<?php

/*
 * This file is part of the symfony package.
 * (c) 2004-2006 Fabien Potencier <*****@*****.**>
 * 
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
$_test_dir = realpath(dirname(__FILE__) . '/..');
require_once dirname(__FILE__) . '/../../config/ProjectConfiguration.class.php';
$configuration = new ProjectConfiguration(realpath($_test_dir . '/..'));
include $configuration->getSymfonyLibDir() . '/vendor/lime/lime.php';
$sf_symfony_lib_dir = $configuration->getSymfonyLibDir();
$sf_root_dir = $configuration->getRootDir();
require_once $sf_symfony_lib_dir . '/autoload/sfSimpleAutoload.class.php';
$autoload = sfSimpleAutoload::getInstance();
$autoload->addDirectory($sf_symfony_lib_dir);
$autoload->addDirectory($sf_root_dir . '/plugins');
$autoload->addDirectory($sf_root_dir . '/lib');
$autoload->register();
// Commenting this out because it seems to be breaking stuff right now
$app_config = $configuration->getApplicationConfiguration('tracker', 'test', true);
$databaseManager = new sfDatabaseManager($app_config);
//$databaseManager->loadConfiguration();
sfContext::createInstance($app_config, 'tracker');
$sessionPath = sfToolkit::getTmpDir() . '/sessions_' . rand(11111, 99999);
$storage = new sfSessionTestStorage(array('session_path' => $sessionPath));
function fixture_url($name, $file_url = true)
{
    global $sf_root_dir;