当前位置: 首页>>代码示例>>PHP>>正文


PHP lime_test::unlike方法代码示例

本文整理汇总了PHP中lime_test::unlike方法的典型用法代码示例。如果您正苦于以下问题:PHP lime_test::unlike方法的具体用法?PHP lime_test::unlike怎么用?PHP lime_test::unlike使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在lime_test的用法示例。


在下文中一共展示了lime_test::unlike方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getPropelConfiguration

}
class sfWebDebugPanelPropelTestDifferentGlue extends sfWebDebugPanelPropel
{
    protected function getPropelConfiguration()
    {
        $config = new PropelConfiguration(array());
        $config->setParameter('debugpdo.logging.outerglue', 'xx');
        $config->setParameter('debugpdo.logging.innerglue', '/ ');
        $config->setParameter('debugpdo.logging.details.slow.enabled', true);
        $config->setParameter('debugpdo.logging.details.slow.threshold', 5);
        return $config;
    }
}
// ->getPanelContent()
$t->diag('->getPanelContent()');
$dispatcher = new sfEventDispatcher();
$logger = new sfVarLogger($dispatcher);
$logger->log('{sfPropelLogger} SELECT * FROM foo WHERE bar<1');
$logger->log('{sfPropelLogger} time: 3.42 sec | mem: 2.8 MB | SELECT * FROM foo WHERE aText like \' | foo\'');
$panel = new sfWebDebugPanelPropelTest(new sfWebDebug($dispatcher, $logger));
$content = $panel->getPanelContent();
$t->like($content, '/bar&lt;1/', '->getPanelContent() returns escaped queries');
$t->like($content, '/aText like &#039; | foo&#039;/', '->getPanelContent() works with glue string in SQL');
$t->like($content, '/sfWebDebugWarning/', '->getPanelContent() contains a slow query warning');
$logger = new sfVarLogger($dispatcher);
$logger->log('{sfPropelLogger} time/ 3.42 secxxmem/ 2.8 MBxxSELECT * FROM foo WHERE bar == 42');
$panel = new sfWebDebugPanelPropelTestDifferentGlue(new sfWebDebug($dispatcher, $logger));
$content = $panel->getPanelContent();
$t->like($content, '/time\\/ 3.42 sec, mem\\/ 2.8 MB/', '->getPanelContent() works with strange glue strings');
$t->unlike($content, '/sfWebDebugWarning/', '->getPanelContent() should not contain a slow warning');
开发者ID:cuongnv540,项目名称:jobeet,代码行数:30,代码来源:sfWebDebugPanelPropelTest.php

示例2: catch

/*************************/
$t->diag('Simple DELETE request');
$t->like($b->delete($dump_headers_url)->getResponseText(), '/\\[REQUEST_METHOD\\] => DELETE/', 'delete() performs a DELETE request');
/*********************/
/* Arbitrary request */
/*********************/
$t->diag('Arbitrary request');
$t->like($b->call($dump_headers_url, 'MICHEL')->getResponseText(), '/\\[REQUEST_METHOD\\] => MICHEL/', 'call() supports any HTTP methods');
/****************************/
/* Response formats methods */
/****************************/
$t->diag('Response formats methods');
$b = $sc->reload('web_browser');
$b->get($example_site_url);
$t->like($b->getResponseText(), '/<body .*>/', 'getResponseText() returns the response text');
$t->unlike($b->getResponseBody(), '/<body>/', 'getResponseBody() returns the response body');
$t->isa_ok($b->getResponseDom(), 'DOMDocument', 'getResponseDom() returns the response Dom');
$t->isa_ok($b->getResponseDomCssSelector(), 'sfDomCssSelector', 'getResponseDomCssSelector() returns a CSS selector on the response Dom');
$b->get('http://rss.cnn.com/rss/cnn_topstories.rss');
$t->isa_ok($b->getResponseXml(), 'SimpleXMLElement', 'getResponseXml() returns the response as a SimpleXML Element');
$b->get('http://www.w3.org/StyleSheets/home.css');
try {
    $b->getResponseXml();
    $t->fail('Incorrect XML throws an exception');
} catch (Exception $e) {
    $t->pass('Incorrect XML throws an exception');
}
try {
    /******************************/
    /* Absolute and relative URls */
    /******************************/
开发者ID:jdart,项目名称:diem,代码行数:31,代码来源:dmWebBrowserTest.php

示例3: array

$t->is(checkbox_tag('name', 'foo'), '<input type="checkbox" name="name" id="name" value="foo" />', 'checkbox_tag() takes a value as its second argument');
$t->is(checkbox_tag('name', null, true), '<input type="checkbox" name="name" id="name" value="" checked="checked" />', 'checkbox_tag() takes a boolean as its third argument');
// options
$t->is(checkbox_tag('name', null, false, array('class' => 'foo')), '<input type="checkbox" name="name" id="name" value="" class="foo" />', 'checkbox_tag() takes an array of attribute options as its fourth argument');
$t->is(checkbox_tag('name', null, false, array('id' => 'foo')), '<input type="checkbox" name="name" id="foo" value="" />', 'checkbox_tag() can override the "id" attribute');
// radiobutton_tag()
$t->diag('radiobutton_tag()');
$t->is(radiobutton_tag('name', 1), '<input type="radio" name="name" id="name_1" value="1" />', 'radiobutton_tag() takes a name as its first argument');
$t->is(radiobutton_tag('name', 2), '<input type="radio" name="name" id="name_2" value="2" />', 'radiobutton_tag() takes a value as its second argument');
$t->is(radiobutton_tag('name', null, true), '<input type="radio" name="name" id="name" value="" checked="checked" />', 'radiobutton_tag() takes a boolean as its third argument');
// options
$t->is(radiobutton_tag('name', null, false, array('class' => 'foo')), '<input type="radio" name="name" id="name" value="" class="foo" />', 'radiobutton_tag() takes an array of attribute options as its fourth argument');
$t->is(radiobutton_tag('name', null, false, array('id' => 'foo')), '<input type="radio" name="name" id="foo" value="" />', 'radiobutton_tag() can override the "id" attribute');
// input_date_range_tag()
$t->diag('input_date_range_tag()');
$t->unlike(input_date_range_tag('date', array('from' => time(), 'to' => time()), array('after' => 'foo')), '/after/', 'input_date_range_tag() output date fields for a date range');
// input_date_tag()
$t->diag('input_date_tag()');
$t->todo('input_date_tag()');
// submit_tag()
$t->diag('submit_tag()');
$t->is(submit_tag(), '<input type="submit" name="commit" value="Save changes" />', 'submit_tag() default value is "Save changes"');
$t->is(submit_tag("save"), '<input type="submit" name="commit" value="save" />', 'submit_tag() takes a value as its first argument');
// options
$t->is(submit_tag('save', array('class' => 'foo')), '<input type="submit" name="commit" value="save" class="foo" />', 'submit_tag() takes an array of attribute options as its second argument');
$t->is(submit_tag('save', array('name' => 'foo')), '<input type="submit" name="foo" value="save" />', 'submit_tag() can override the "name" attribute');
// reset_tag()
$t->diag('reset_tag()');
$t->is(reset_tag(), '<input type="reset" name="reset" value="Reset" />', 'reset_tag() default value is "Reset"');
$t->is(reset_tag("save"), '<input type="reset" name="reset" value="save" />', 'reset_tag() takes a value as its first argument');
// options
开发者ID:valerio-bozzolan,项目名称:openparlamento,代码行数:31,代码来源:FormHelperTest.php

示例4: array

        <option value="selected" selected="selected">selected</option>
        <option value="last">last</option>
      </select>
    </form>
  </body>
</html>
EOF;
$xml = $f->fillInXml($xml, 'form', null, array('foo' => 'bar'));
$t->like($xml, '#<input type="text" name="foo" value="bar"\\s*/>#', '->fillInXml() outputs valid XML');
$t->like($xml, '#<option value="selected" selected="selected">#', '->fillInXml() outputs valid XML');
$t->like($xml, '#<\\?xml version="1.0"\\?>#', '->fillInXml() outputs XML prolog');
// ->fillInXhtml()
$xml = $f->fillInXhtml($xml, 'form', null, array('foo' => 'bar'));
$t->like($xml, '#<input type="text" name="foo" value="bar"\\s*/>#', '->fillInXhml() outputs valid XML');
$t->like($xml, '#<option value="selected" selected="selected">#', '->fillInXhml() outputs valid XML');
$t->unlike($xml, '#<\\?xml version="1.0"\\?>#', '->fillInXhtml() does not output XML prolog');
// ->fillInHtml()
$t->diag('->fillInHtml()');
$f = new sfFillInForm();
$xml = <<<EOF
<html>
  <body>
    <form action="#" method="post" name="form">
      <input type="text" name="foo">
      <select name="select">
        <option value="first">first</option>
        <option value="selected" selected="selected">selected</option>
        <option value="last">last</option>
      </select>
    </form>
  </body>
开发者ID:bigcalm,项目名称:urlcatcher,代码行数:31,代码来源:sfFillInFormTest.php

示例5: __construct

class sfWebDebugTest extends sfWebDebug
{
    public function __construct()
    {
        $this->options['image_root_path'] = '';
        $this->options['request_parameters'] = array();
    }
}
$debug = new sfWebDebugTest();
// ->injectToolbar()
$t->diag('->injectToolbar()');
$before = '<html><head></head><body></body></html>';
$after = $debug->injectToolbar($before);
$t->like($after, '/<style type="text\\/css">/', '->injectToolbar() adds styles');
$t->like($after, '/<div id="sfWebDebug">/', '->injectToolbar() adds the toolbar');
$before = '';
$after = $debug->injectToolbar($before);
$t->unlike($after, '/<style type="text\\/css">/', '->injectToolbar() does not add styles if there is no head');
$t->like($after, '/<div id="sfWebDebug">/', '->injectToolbar() adds the toolbar if there is no body');
$before = <<<HTML
<html>
<head></head>
<body>
<textarea><html><head></head><body></body></html></textarea>
</body>
</html>
HTML;
$after = $debug->injectToolbar($before);
$t->is(substr_count($after, '<style type="text/css">'), 1, '->injectToolbar() adds styles once');
$t->is(substr_count($after, '<div id="sfWebDebug">'), 1, '->injectToolbar() adds styles once');
$t->isa_ok(strpos($after, '<textarea><html><head></head><body></body></html></textarea>'), 'integer', '->injectToolbar() leaves inner pages untouched');
开发者ID:nelsonlrp,项目名称:Acad-mico,代码行数:31,代码来源:sfWebDebugTest.php

示例6: catch

        $t->fail(sprintf('filters.yml must have a filter of type "%s"', $key));
    } catch (sfParseException $e) {
        $t->like($e->getMessage(), sprintf('/must register a filter of type "%s"/', $key), sprintf('filters.yml must have a filter of type "%s"', $key));
    }
}
// filter inheritance
$t->diag('filter inheritance');
$files = array($dir . 'default_filters.yml', $dir . 'not_disabled.yml');
try {
    $data = $handler->execute($files);
    $t->fail('filters.yml must keep all filters when inheriting from a master filters configuration file');
} catch (sfConfigurationException $e) {
    $t->like($e->getMessage(), '/but not present/', 'filters.yml must keep all filters when inheriting from a master filters configuration file');
}
// disabling a filter
$t->diag('disabling a filter');
$files = array($dir . 'disable.yml');
$t->unlike($handler->execute($files), '/defaultFilterClass/', 'you can disable a filter by settings "enabled" to false');
// condition support
$t->diag('condition support');
$files = array($dir . 'condition.yml');
sfConfig::set('default_test', true);
$t->like($handler->execute($files), '/defaultFilterClass/', 'you can add a "condition" key to the filter parameters');
sfConfig::set('default_test', false);
$t->unlike($handler->execute($files), '/defaultFilterClass/', 'you can add a "condition" key to the filter parameters');
// usual configuration
$t->diag('usual configuration');
$files = array($dir . 'default_filters.yml', $dir . 'filters.yml');
$data = $handler->execute($files);
$data = preg_replace('#date\\: \\d+/\\d+/\\d+ \\d+\\:\\d+\\:\\d+\\n#', '', $data);
$t->is($data, str_replace("\r\n", "\n", file_get_contents($dir . 'result.php')), 'core filters.yml can be overriden');
开发者ID:hunde,项目名称:bsc,代码行数:31,代码来源:sfFilterConfigHandlerTest.php

示例7: array

    {
        $this->options['image_root_path'] = '';
        $this->options['request_parameters'] = array();
    }
}
$debug = new sfWebDebugTest();
// ->injectToolbar()
$t->diag('->injectToolbar()');
$before = '<html><head></head><body></body></html>';
$after = $debug->injectToolbar($before);
$t->like($after, '/<style type="text\\/css">/', '->injectToolbar() adds styles');
$t->like($after, '/<script type="text\\/javascript">/', '->injectToolbar() adds javascript');
$t->like($after, '/<div id="sfWebDebug">/', '->injectToolbar() adds the toolbar');
$before = '';
$after = $debug->injectToolbar($before);
$t->unlike($after, '/<style type="text\\/css">/', '->injectToolbar() does not add styles if there is no head');
$t->unlike($after, '/<script type="text\\/javascript">/', '->injectToolbar() does not add javascripts if there is no body');
$t->like($after, '/<div id="sfWebDebug">/', '->injectToolbar() adds the toolbar if there is no body');
$before = <<<HTML
<html>
<head></head>
<body>
<textarea><html><head></head><body></body></html></textarea>
</body>
</html>
HTML;
$after = $debug->injectToolbar($before);
$t->is(substr_count($after, '<style type="text/css">'), 1, '->injectToolbar() adds styles once');
$t->is(substr_count($after, '<script type="text/javascript">'), 1, '->injectToolbar() adds javascripts once');
$t->is(substr_count($after, '<div id="sfWebDebug">'), 1, '->injectToolbar() adds styles once');
$t->isa_ok(strpos($after, '<textarea><html><head></head><body></body></html></textarea>'), 'integer', '->injectToolbar() leaves inner pages untouched');
开发者ID:sensorsix,项目名称:app,代码行数:31,代码来源:sfWebDebugTest.php

示例8: dirname

require_once dirname(__FILE__) . '/../bootstrap/task.php';
# load fixtures of this plugin
$propelData->loadData(sfConfig::get('sf_plugins_dir') . '/sfNewsletterPlugin/data/fixtures');
$limeTest = new lime_test(6, new lime_output_color());
sfConfig::set('sf_newsletterplugin_from', '');
$task = new SendScheduledNewsletterTask($dispatcher, $formatter);
try {
    $task->run(array(), array());
    $limeTest->fail('InvalidArgumentException not thrown.');
} catch (InvalidArgumentException $e) {
    $limeTest->is($e->getMessage(), sfNewsletterPluginConfiguration::EXCEPTION_NO_SENDER, 'Caught correct Exception.');
}
sfConfig::set('sf_newsletterplugin_from', 'invalid-email');
try {
    $task->run(array(), array());
    $limeTest->fail('InvalidArgumentException not thrown.');
} catch (InvalidArgumentException $e) {
    $limeTest->like($e->getMessage(), '/' . sfNewsletterPluginConfiguration::EXCEPTION_INVALID_SENDER . '/', 'Caught correct Exception.');
}
sfConfig::set('sf_newsletterplugin_from', 'email@example.com');
$task->run(array(), array());
$logs = $logger->getLogEntries();
$limeTest->like($logs[2], '/There are no newsletters on schedule./', 'Task exits while no newsletter are given.');
$newsletter = NewsletterPeer::retrieveByName('first newsletter');
$limeTest->ok($newsletter->setScheduledAt(new DateTime('-7 hours'))->save(), 'Scheduled Newsletter.');
$limeTest->is(count(NewsletterPeer::retrieveScheduled(new DateTime('-6 hours'))), 1, 'Found scheduled Newsletter.');
$task->run(array(), array('schedule="-6 hours"'));
$logs = $logger->getLogEntries();
$limeTest->unlike($logs[3], '/' . sfNewsletterPluginConfiguration::EXCEPTION_SWIFT_ERROR . '/', 'Email sent successfully.');
// @todo Add test checking POP3 to verify the email really got there!
开发者ID:havvg,项目名称:sfNewsletterPlugin,代码行数:30,代码来源:sfNewsletterPlugin-SendScheduledNewsletterTaskTest.php


注:本文中的lime_test::unlike方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。