* (c) 2007 - 2008 Carl Vondrick <*****@*****.**> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /** * @package sfLucenePlugin * @subpackage Test * @author Carl Vondrick * @version SVN: $Id: sfLucenePropelInitializerTest.php 7108 2008-01-20 07:44:42Z Carl.Vondrick $ */ require dirname(__FILE__) . '/../../bootstrap/unit.php'; $t = new limeade_test(4, limeade_output::get()); $limeade = new limeade_sf($t); $app = $limeade->bootstrap(); $luceneade = new limeade_lucene($limeade); $luceneade->configure()->clear_sandbox()->load_models(); class FooBehavior extends sfPropelBehavior { public static function getBehaviors() { return self::$behaviors; } } class FooMixer extends sfMixer { public static function getMixins() { return self::$mixins; } }
* (c) 2007 - 2008 Carl Vondrick <*****@*****.**> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /** * @package sfLucenePlugin * @subpackage Test * @author Carl Vondrick * @version SVN: $Id: sfLuceneTest.php 7108 2008-01-20 07:44:42Z Carl.Vondrick $ */ require dirname(__FILE__) . '/../bootstrap/unit.php'; $t = new limeade_test(91, limeade_output::get()); $limeade = new limeade_sf($t); $app = $limeade->bootstrap(); $luceneade = new limeade_lucene($limeade); $luceneade->configure()->clear_sandbox(); $t->diag('testing ::getInstance()'); $t->ok(!is_dir(sfConfig::get('sf_data_dir') . '/index/testLucene/en'), 'Lucene directory does not initially exist'); try { $e = $t->no_exception('::getInstance() allows valid cultures'); $lucene = sfLucene::getInstance('testLucene', 'en'); $e->no(); } catch (Exception $ex) { $e->caught($ex); } $t->ok(is_dir(sfConfig::get('sf_data_dir') . '/index/testLucene/en'), '::getInstance() creates the index'); $stat = stat(sfConfig::get('sf_data_dir') . '/index/testLucene/en/segments.gen'); $lucene->unlatch(); unset($lucene); try {
* (c) 2007 - 2008 Carl Vondrick <*****@*****.**> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /** * @package sfLucenePlugin * @subpackage Test * @author Carl Vondrick * @version SVN: $Id: sfLuceneCriteriaTest.php 7108 2008-01-20 07:44:42Z Carl.Vondrick $ */ require dirname(__FILE__) . '/../../bootstrap/unit.php'; $t = new limeade_test(53, limeade_output::get()); $limeade = new limeade_sf($t); $limeade->bootstrap(); $luceneade = new limeade_lucene($limeade); $luceneade->configure(); class Foo { } function inst() { return sfLuceneCriteria::newInstance(sfLucene::getInstance('testLucene')); } $t->diag('testing constructors'); try { $criteria = new sfLuceneCriteria(sfLucene::getInstance('testLucene')); $t->pass('__construct() takes a sfLucene instance'); } catch (Exception $e) { $t->fail('__construct() takes a sfLuce instance'); }