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


PHP teardown函数代码示例

本文整理汇总了PHP中teardown函数的典型用法代码示例。如果您正苦于以下问题:PHP teardown函数的具体用法?PHP teardown怎么用?PHP teardown使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: tearDownAfterClass

 public static function tearDownAfterClass()
 {
     if (defined('SKIPPING')) {
         return;
     }
     teardown(self::$db, DB_WIPE_FILE);
 }
开发者ID:nurulimamnotes,项目名称:flourish-old,代码行数:7,代码来源:fSQLTranslationTest.php

示例2: tearDownAfterClass

 public static function tearDownAfterClass()
 {
     if (defined('SKIPPING')) {
         return;
     }
     self::$db->execute(fix_schema(file_get_contents(DB_ALTERNATE_SCHEMA_WIPE_FILE)));
     teardown(self::$db, DB_WIPE_FILE);
 }
开发者ID:nurulimamnotes,项目名称:flourish-old,代码行数:8,代码来源:fSchemaWithMultipleSchemasTest.php

示例3: tearDownAfterClass

 public static function tearDownAfterClass()
 {
     if (defined('SKIPPING')) {
         return;
     }
     teardown(self::$db, DB_EXTENDED_TEARDOWN_FILE);
     teardown(self::$db, DB_TEARDOWN_FILE);
 }
开发者ID:netcarver,项目名称:flourish,代码行数:8,代码来源:fORMValidationTest.php

示例4: tearDownAfterClass

 public static function tearDownAfterClass()
 {
     if (defined('SKIPPING')) {
         return;
     }
     teardown(self::$db, DB_TEARDOWN_FILE);
     self::$db->__destruct();
 }
开发者ID:netcarver,项目名称:flourish,代码行数:8,代码来源:fDatabaseTest.php

示例5: assert_equals

     assert_equals(true, transient()->setup1);
 });
 // TODO this is terrible
 should("count the number of tests", function () {
     assert_equals(4, Smoothie::instance()->tests);
 });
 // TODO this is terrible
 should("count the number of assertions", function () {
     assert_equals(4, Smoothie::instance()->assertions);
 });
 context("nested in a context", function () {
     setup(function () {
         transient()->setup2 = true;
     });
     teardown(function () {
         $GLOBALS['I_RAN_TEARDOWN'] = true;
     });
     should("have called its parent setup", function () {
         assert_equals(true, transient()->setup1);
     });
     should("have called its own setup", function () {
         assert_equals(true, transient()->setup2);
     });
     context("nested in a context", function () {
         setup(function () {
             transient()->setup3 = true;
         });
         should("have called all three setups", function () {
             assert_equals(true, transient()->setup1);
             assert_equals(true, transient()->setup2);
             assert_equals(true, transient()->setup3);
开发者ID:kla,项目名称:smoothie,代码行数:31,代码来源:ContextTest.php

示例6: write_xml

/**
 * Write XML data to a file.
 * @param string $contents
 * @param string $xml_path where we write this
 */
function write_xml($contents, $xml_path)
{
    if ($fh = @fopen($xml_path, 'w')) {
        fwrite($fh, $contents);
        fclose($fh);
        print 'config.xml file written at ' . $xml_path . PHP_EOL;
    } else {
        print 'There was a problem opening ' . $xml_path . ' for writing.' . PHP_EOL;
        print 'You can paste the following contents into ' . $xml_path . PHP_EOL;
        print 'and then run:  php ./index.php --installmode=new' . PHP_EOL;
        print 'or navigate to your site via a browser and do a normal installation.' . PHP_EOL . PHP_EOL;
        print $contents;
        print PHP_EOL . PHP_EOL;
        teardown();
    }
}
开发者ID:Vitaliz,项目名称:modx_utils,代码行数:21,代码来源:installmodx.php

示例7: suite

<?php

/*
 * How to use teardown
 */
namespace Preview\DSL\TDD;

require_once __DIR__ . '/../ok.php';
suite("teardown", function () {
    teardown(function () {
        $this->usage = "run teardown each test case";
    });
    teardown(function () {
        $this->note = "teardown hooks are run in order";
    });
});
开发者ID:v2e4lisp,项目名称:preview,代码行数:16,代码来源:teardown_spec.php


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