本文整理汇总了PHP中lmbToolkit::merge方法的典型用法代码示例。如果您正苦于以下问题:PHP lmbToolkit::merge方法的具体用法?PHP lmbToolkit::merge怎么用?PHP lmbToolkit::merge使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lmbToolkit
的用法示例。
在下文中一共展示了lmbToolkit::merge方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
function setUp()
{
lmbToolkit::save();
$this->toolkit = lmbToolkit::merge(new lmbLogTools());
$_SERVER['REQUEST_URI'] = null;
$_SERVER['REQUEST_METHOD'] = null;
}
示例2: testWrite
function testWrite()
{
lmbToolkit::merge(new lmbNetTools());
lmbToolkit::instance()->setResponse(new lmbHttpResponseForLogTest());
$writer = new lmbLogFirePHPWriter(new lmbUri('firePHP://localhost/?check_extension=0'));
$writer->write(new lmbLogEntry(LOG_ERR, 'foo'));
$headers = lmbToolkit::instance()->getResponse()->getHeaders();
$this->assertPattern('/Error/', $headers[4]);
$this->assertPattern('/foo/', $headers[4]);
}
示例3: setUp
function setUp()
{
lmbToolkit::save();
$this->toolkit = lmbToolkit::merge(new lmbConfTools());
$this->application_configs_dir = lmb_var_dir() . '/app/settings';
lmbFs::mkdir($this->application_configs_dir);
$this->package_configs_dir = lmb_var_dir() . '/package/settings';
lmbFs::mkdir($this->package_configs_dir);
$tests_include_apth = $this->application_configs_dir . ';' . $this->package_configs_dir;
$this->toolkit->setConfIncludePath($tests_include_apth);
}
示例4: testSetErrorLevelByDSN
function testSetErrorLevelByDSN()
{
lmbToolkit::merge(new lmbNetTools());
lmbToolkit::instance()->setResponse(new lmbHttpResponseForLogTest());
$writer = new lmbLogFirePHPWriter(new lmbUri('firePHP://localhost/?check_extension=0&level=' . LOG_WARNING));
$result = $writer->write(new lmbLogEntry(LOG_ERR, 'foo'));
$result = $writer->write(new lmbLogEntry(LOG_NOTICE, 'foonotice'));
$headers = lmbToolkit::instance()->getResponse()->getHeaders();
$this->assertPattern('/Error/', $headers[4]);
$this->assertPattern('/foo/', $headers[4]);
$this->assertNoPattern('/Notice/', $headers[4]);
$this->assertNoPattern('/foonotice/', $headers[4]);
}
示例5: testAddVersionToUrl_Safe
function testAddVersionToUrl_Safe()
{
$toolkit = lmbToolkit::merge(new lmbWebAppTools());
lmb_env_set('LIMB_DOCUMENT_ROOT', null);
try {
$url = $toolkit->addVersionToUrl('js/main.js', true);
$this->assertEqual($url, 'js/main.js?00');
$this->assertTrue(true);
} catch (lmbException $e) {
$this->assertTrue(false);
}
lmb_env_set('LIMB_DOCUMENT_ROOT', lmb_env_get('LIMB_VAR_DIR') . '/www');
lmbFs::rm(lmb_env_get('LIMB_DOCUMENT_ROOT') . '/js/main.js');
try {
$url = $toolkit->addVersionToUrl('js/main.js', true);
$this->assertEqual('js/main.js?00', $url);
$this->assertTrue(true);
} catch (lmbException $e) {
$this->assertTrue(false);
}
}
示例6: lmb_require
<?php
/*
* Limb PHP Framework
*
* @link http://limb-project.com
* @copyright Copyright © 2004-2007 BIT(http://bit-creative.com)
* @license LGPL http://www.gnu.org/copyleft/lesser.html
*/
/**
* @package cms
* @version $Id: toolkit.inc.php 6598 2007-12-07 08:01:45Z pachanga $
*/
lmb_require('limb/toolkit/src/lmbToolkit.class.php');
lmb_require('limb/cms/src/toolkit/lmbCmsTools.class.php');
lmbToolkit::merge(new lmbCmsTools());
示例7: lmb_require
<?php
/*
* Limb PHP Framework
*
* @link http://limb-project.com
* @copyright Copyright © 2004-2009 BIT(http://bit-creative.com)
* @license LGPL http://www.gnu.org/copyleft/lesser.html
*/
/**
* @package active_record
* @version $Id$
*/
lmb_require('limb/toolkit/src/lmbToolkit.class.php');
lmb_require('limb/active_record/src/toolkit/lmbARTools.class.php');
lmbToolkit::merge(new lmbARTools());
示例8: testMergeSeveral
function testMergeSeveral()
{
lmbToolkit::save();
lmbToolkit::merge(new TestTools());
$toolkit = lmbToolkit::save();
$toolkit->commonMethod();
$toolkit->commonMethod();
$this->assertEqual($toolkit->getCommonMethodCalls(), 2);
$toolkit = lmbToolkit::merge(new TestTools());
$this->assertEqual($toolkit->getCommonMethodCalls(), 0);
$toolkit = lmbToolkit::instance();
$toolkit->commonMethod();
$this->assertEqual($toolkit->getCommonMethodCalls(), 1);
$toolkit = lmbToolkit::restore();
$this->assertEqual($toolkit->getCommonMethodCalls(), 0);
lmbToolkit::restore();
}
示例9: setUp
function setUp()
{
lmbToolkit::save();
$this->toolkit = lmbToolkit::merge(new lmbLogTools());
}
示例10: lmb_require
<?php
/*
* Limb PHP Framework
*
* @link http://limb-project.com
* @copyright Copyright © 2004-2009 BIT(http://bit-creative.com)
* @license LGPL http://www.gnu.org/copyleft/lesser.html
*/
/**
* @package fs
* @version $Id$
*/
lmb_require('limb/toolkit/src/lmbToolkit.class.php');
lmb_require('limb/fs/src/lmbFsTools.class.php');
lmbToolkit::merge(new lmbFsTools());
示例11: setUp
function setUp()
{
lmbToolkit::save();
lmbToolkit::merge(new lmbProfileTools());
$this->toolkit = lmbToolkit::instance();
}
示例12: testSaveAndRestoreToolsMethods
function testSaveAndRestoreToolsMethods()
{
lmbToolkit::save();
$toolkit = lmbToolkit::setup(new TestTools());
$this->assertEqual($toolkit->commonMethod(), 'commonMethod1');
lmbToolkit::save();
lmbToolkit::merge(new TestTools2());
$this->assertEqual($toolkit->commonMethod(), 'commonMethod2');
lmbToolkit::restore();
$this->assertEqual($toolkit->commonMethod(), 'commonMethod1');
lmbToolkit::restore();
}
示例13: getMember
$this->member = $member;
}
function getMember()
{
return $this->member;
}
function setAcl($value)
{
$this->acl = $value;
}
function getAcl()
{
return $this->acl;
}
}
lmbToolkit::merge(new FakeMemberAndAclTools());
class lmbAllowedTagTest extends lmbBaseMacroTest
{
function setUp()
{
parent::setUp();
$acl = new lmbAcl();
$acl->addRole('boy');
$acl->addRole('man');
$acl->addResource('girl');
$acl->allow('boy', 'girl', 'sex');
$acl->allow('man', 'girl', 'marry');
$acl->addResource('vodka');
$acl->allow('man', 'vodka');
lmbToolkit::instance()->setAcl($acl);
$this->tags_dir = realpath(dirname(__FILE__) . '/../../../src/macro');
示例14: testNoSuchController
function testNoSuchController()
{
$this->filter->setDefaultControllerName($default_controller_name = '404');
$dispatched_params = array('controller' => $exception_controller_name = 'no_such_controller' . time());
$this->_setUpMocks($dispatched_params);
$tools = new lmbRequestDispatchingFilterTestTools($exception_controller_name);
$tools->setController($controller = new lmbRequestDispatchingTestingController($default_controller_name));
$this->toolkit = lmbToolkit::merge($tools);
$this->filter->run($this->chain);
$this->_assertDispatchedOk($controller, 'display', __LINE__);
}