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


PHP test类代码示例

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


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

示例1: asd

function asd()
{
    $newClass = new test();
    $rows = $newClass->traerAlgoDesdeLaDb();
    $viewData = array("id" => 5, "datos" => $rows);
    View::Show($viewData);
}
开发者ID:afliw,项目名称:ponponpon,代码行数:7,代码来源:testController.php

示例2: assert_equal_array

 public function assert_equal_array($expected, $actual, $debug = null)
 {
     if ($expected !== $actual) {
         throw new Kohana_Unit_Test_Exception(sprintf("Expected (%s) %s but received (%s) %s\n Diff: %s", gettype($expected), var_export($expected, true), gettype($actual), var_export($actual, true), test::diff(var_export($expected, true), var_export($actual, true))), $debug);
     }
     return $this;
 }
开发者ID:HarriLu,项目名称:gallery3,代码行数:7,代码来源:Gallery_Unit_Test_Case.php

示例3: random_tag

 static function random_tag()
 {
     $tag = ORM::factory("tag");
     $tag->name = test::lorem_ipsum(rand(2, 4));
     // Reload so that ORM coerces all fields into strings.
     return $tag->save()->reload();
 }
开发者ID:assad2012,项目名称:gallery3-appfog,代码行数:7,代码来源:test.php

示例4: testTranslateInto

 public function testTranslateInto()
 {
     $expectedFromTranslate = "MOCKED_RESULT";
     $this->mockedTranslator = test::double('Translator', ['translate' => '$expectedFromTranslate']);
     $result = $this->numbers->translateInto(2, "MOCKED");
     $this->assertEquals($expectedFromTranslate, $result, "Incorrect value returned from translateInto()");
 }
开发者ID:JoshuaReneDalley,项目名称:php,代码行数:7,代码来源:NumbersTest.php

示例5: resolve_test

 public function resolve_test()
 {
     $album = test::random_album();
     $tag = tag::add($album, "tag1")->reload();
     $tuple = rest::resolve(rest::url("tag_item", $tag, $album));
     $this->assert_equal_array($tag->as_array(), $tuple[0]->as_array());
     $this->assert_equal_array($album->as_array(), $tuple[1]->as_array());
 }
开发者ID:andyst,项目名称:gallery3,代码行数:8,代码来源:Tag_Item_Rest_Helper_Test.php

示例6: add_user_to_group_test

 public function add_user_to_group_test()
 {
     $user = test::random_user();
     $group = test::random_group();
     $group->add($user);
     $group->save();
     $this->assert_true($user->has($group));
 }
开发者ID:andyst,项目名称:gallery3,代码行数:8,代码来源:User_Groups_Test.php

示例7: selectById

 public function selectById($thepage, $id)
 {
     switch ($thepage) {
         case 'test':
             $test = new test();
             $result = $test->select($_GET['id']);
             break;
         default:
             //$this->common_add($_POST,$thepage);
             break;
     }
     if ($result) {
         return $result;
     } else {
         return NULL;
     }
 }
开发者ID:huangzhichao,项目名称:php_dwz,代码行数:17,代码来源:Control.class.php

示例8: _before

 protected function _before()
 {
     $this->apigen = test::double('Robo\\Task\\ApiGen\\ApiGen', ['executeCommand' => null, 'output' => new \Symfony\Component\Console\Output\NullOutput()]);
     if (!defined('DS')) {
         define('DS', DIRECTORY_SEPARATOR);
     }
     $this->testDir = __DIR__ . '..' . DS . '..' . DS . 'data' . DS;
     $this->testFile = $this->testDir . 'dump.sql';
 }
开发者ID:jjok,项目名称:Robo,代码行数:9,代码来源:ResourceExistenceChecker.php

示例9: factory

 static function factory($x)
 {
     if (test::$test) {
         return test::$test;
     } else {
         test::$test = new test($x);
         return test::$test;
     }
 }
开发者ID:lihuibin,项目名称:jphp,代码行数:9,代码来源:factory_and_singleton_001.php

示例10: getInstance

 public static function getInstance()
 {
     if (self::$instance == null) {
         self::$instance = new test('Singleton1');
     } else {
         echo "Using old class " . self::$instance->myname . "\n";
     }
     return self::$instance;
 }
开发者ID:badlamer,项目名称:hhvm,代码行数:9,代码来源:bug32322.php

示例11: build_breadcrumbs_for_item_test

 public function build_breadcrumbs_for_item_test()
 {
     $album = test::random_album();
     $item = test::random_photo($album);
     $expected = array();
     $expected[] = Breadcrumb::instance(item::root()->title, item::root()->url("show={$album->id}"))->set_first();
     $expected[] = Breadcrumb::instance($album->title, $album->url("show={$item->id}"));
     $expected[] = Breadcrumb::instance($item->title, $item->url())->set_last();
     $this->assert_equal($expected, Breadcrumb::array_from_item_parents($item));
 }
开发者ID:HarriLu,项目名称:gallery3,代码行数:10,代码来源:Breadcrumb_Test.php

示例12: _get_proxy

 private function _get_proxy()
 {
     $album = test::random_album();
     $photo = test::random_photo($album);
     access::deny(identity::everybody(), "view_full", $album);
     access::deny(identity::registered_users(), "view_full", $album);
     $proxy = ORM::factory("digibug_proxy");
     $proxy->uuid = random::hash();
     $proxy->item_id = $photo->id;
     return $proxy->save();
 }
开发者ID:webmatter,项目名称:gallery3-contrib,代码行数:11,代码来源:Digibug_Controller_Test.php

示例13: create_tag_test

 public function create_tag_test()
 {
     $album = test::random_album();
     tag::add($album, "tag1");
     $tag = ORM::factory("tag")->where("name", "=", "tag1")->find();
     $this->assert_true(1, $tag->count);
     // Make sure adding the tag again doesn't increase the count
     tag::add($album, "tag1");
     $this->assert_true(1, $tag->reload()->count);
     tag::add(test::random_album(), "tag1");
     $this->assert_true(2, $tag->reload()->count);
 }
开发者ID:Joe7,项目名称:gallery3,代码行数:12,代码来源:Tag_Test.php

示例14: deleting_an_item_deletes_its_comments_too_test

 public function deleting_an_item_deletes_its_comments_too_test()
 {
     $album = test::random_album();
     $comment = ORM::factory("comment");
     $comment->item_id = $album->id;
     $comment->author_id = identity::guest()->id;
     $comment->guest_name = "test";
     $comment->text = "text";
     $comment->save();
     $album->delete();
     $this->assert_false(ORM::factory("comment", $comment->id)->loaded());
 }
开发者ID:andyst,项目名称:gallery3,代码行数:12,代码来源:Comment_Event_Test.php

示例15: validate_config

 /**
  * Validate item config
  *
  * @since 0.3.0
  *
  * @access protected
  *
  * @param array $data Item config
  *
  * @return bool|array Item config array if valid, false if not.
  */
 protected static function validate_config($data)
 {
     if (!isset($data['created'])) {
         $data['created'] = current_time('mysql');
     }
     if (!isset($data['IP'])) {
         $data['IP'] = ingot_get_ip();
     }
     if (!isset($data['uID'])) {
         $data['uID'] = get_current_user_id();
     }
     if (!isset($data['slug'])) {
         $data['slug'] = self::get_slug();
     }
     if (!isset($data['used'])) {
         $data['used'] = 0;
     }
     if (isset($data['click_test_ID'])) {
         $data['click_test_ID'] = absint($data['click_test_ID']);
     } else {
         $data['click_test_ID'] = 0;
     }
     if ($data['click_test_ID']) {
         $test = test::read($data['click_test_ID']);
         if (!is_array($test)) {
             $data['click_test_ID'] = 0;
         }
     }
     if (isset($data['click_url'])) {
         $data['click_url'] = esc_url_raw($data['click_url']);
     } else {
         $data['click_url'] = '';
     }
     if (!isset($data['ingot_ID'])) {
         $data['ingot_ID'] = self::find_ingot_id($data['uID'], $data['IP']);
     }
     $data['used'] = (bool) $data['used'];
     $data['used'] = (int) $data['used'];
     foreach (self::required() as $key) {
         if (!isset($data[$key])) {
             return new \WP_Error('ingot-session-crud-validation-fail', '', array('fail-key' => $key, 'data' => $data));
         }
     }
     $allowed = array_merge(self::required(), self::needed());
     foreach ($data as $key => $datum) {
         if (!in_array($key, $allowed)) {
             unset($data[$key]);
         } elseif (is_numeric($datum)) {
             $data[$key] = (string) $datum;
         }
     }
     return $data;
 }
开发者ID:Ramoonus,项目名称:ingot,代码行数:64,代码来源:session.php


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