當前位置: 首頁>>代碼示例>>PHP>>正文


PHP FunctionalTester::assertEquals方法代碼示例

本文整理匯總了PHP中FunctionalTester::assertEquals方法的典型用法代碼示例。如果您正苦於以下問題:PHP FunctionalTester::assertEquals方法的具體用法?PHP FunctionalTester::assertEquals怎麽用?PHP FunctionalTester::assertEquals使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在FunctionalTester的用法示例。


在下文中一共展示了FunctionalTester::assertEquals方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: it_should_alter_the_user_table

 /**
  * @test
  * it should alter the users table
  */
 public function it_should_alter_the_user_table(FunctionalTester $I)
 {
     $first = $I->haveMultisiteInDatabase();
     $second = $I->haveMultisiteInDatabase();
     foreach ($second as $table => $output) {
         $I->assertEquals('alter', $output['operation']);
         $I->assertEquals($table == 'users', $output['exit']);
     }
 }
開發者ID:LeRondPoint,項目名稱:wp-browser,代碼行數:13,代碼來源:WPDbMultisiteCest.php

示例2: returnExistingCharges

 public function returnExistingCharges(FunctionalTester $I)
 {
     $repo = app('\\BB\\Repo\\SubscriptionChargeRepository');
     /** @var \BB\Repo\SubscriptionChargeRepository $repo */
     $userId = 23;
     $amount = rand(5, 30);
     $chargeDate1 = Carbon::now()->subMonth();
     $chargeDate2 = Carbon::now();
     $repo->createCharge($userId, $chargeDate1, $amount);
     $repo->createCharge($userId, $chargeDate2, $amount);
     $charges = $repo->getMemberCharges($userId);
     $I->assertEquals(2, $charges->count());
     $I->assertEquals($amount, $charges->first()->amount);
     $I->assertEquals($chargeDate2->setTime(0, 0, 0), $charges->first()->charge_date);
 }
開發者ID:adamstrawson,項目名稱:BBMembershipSystem,代碼行數:15,代碼來源:SubscriptionChargeRepoCest.php

示例3: ResponseOfInvalidSource

 public function ResponseOfInvalidSource(Tester $I)
 {
     $I->wantToTest('response if we provide an Invalid Source');
     $I->haveHttpHeader("apikey", $this->apiInfo[Helper::CSV_ORDER_APIKEY]);
     $I->sendGET("currenttime", ["source" => 'airfares']);
     //Not matching the API Key
     $I->assertEquals(json_decode('{"code": "2","message":"Invalid source."}'), json_decode($I->grabResponse()));
 }
開發者ID:parisqian-misa,項目名稱:NTUC-API,代碼行數:8,代碼來源:CurrenttimeCest.php

示例4: it_should_allow_inserting_many_posts_and_return_an_array_of_ids

 /**
  * @test
  * it should allow inserting many posts and return an array of ids
  */
 public function it_should_allow_inserting_many_posts_and_return_an_array_of_ids(FunctionalTester $I)
 {
     $ids = $I->haveManyPostsInDatabase(5);
     $I->assertEquals(5, count(array_unique($ids)));
     array_map(function ($id) use($I) {
         $I->assertTrue(is_int($id));
     }, $ids);
 }
開發者ID:lucatume,項目名稱:wp-browser,代碼行數:12,代碼來源:WPDbPostCest.php

示例5: testSubChargeFetching

 /**
  * Confirm sub charge records can be created and fetched
  *
  * @param FunctionalTester $I
  */
 public function testSubChargeFetching(FunctionalTester $I)
 {
     $subChargeRepo = App::make('\\BB\\Repo\\SubscriptionChargeRepository');
     $subChargeRepo->createCharge(10, Carbon::now());
     $charge = $subChargeRepo->findCharge(10);
     $I->assertNotNull($charge);
     $I->assertEquals(10, $charge->user_id);
 }
開發者ID:adamstrawson,項目名稱:BBMembershipSystem,代碼行數:13,代碼來源:TestPaymentProcessesCest.php

示例6: it_should_allow_getting_non_blog_id_prefixed_table_names_for_main_blog

 /**
  * @test
  * it should allow getting non blog id prefixed table names for main blog
  */
 public function it_should_allow_getting_non_blog_id_prefixed_table_names_for_main_blog(FunctionalTester $I)
 {
     $tables = ['commentmeta', 'comments', 'links', 'options', 'postmeta', 'posts', 'term_relationships', 'term_taxonomy', 'terms', 'termmeta'];
     foreach ($tables as $table) {
         $I->useMainBlog();
         $tableName = $I->grabPrefixedTableNameFor($table);
         $I->assertEquals($I->grabTablePrefix() . $table, $tableName);
     }
 }
開發者ID:LeRondPoint,項目名稱:wp-browser,代碼行數:13,代碼來源:WPDbTablePrefixCest.php

示例7: it_should_allow_having_many_comments_with_number_placeholder

 /**
  * @test
  * it should allow having many comments with number placeholder
  */
 public function it_should_allow_having_many_comments_with_number_placeholder(FunctionalTester $I)
 {
     $postId = $I->havePostInDatabase();
     $overrides = ['comment_author' => 'Luca', 'comment_author_email' => 'luca@example.com', 'comment_author_url' => 'https://theaveragedev.com', 'comment_author_IP' => '111.222.333.444', 'comment_date' => Date::now(), 'comment_date_gmt' => Date::gmtNow(), 'comment_content' => "No comment", 'comment_karma' => '3', 'comment_approved' => '0', 'comment_agent' => 'some agent', 'comment_type' => 'status', 'comment_parent' => 23, 'user_id' => 12];
     $ids = $I->haveManyCommentsInDatabase(5, $postId, $overrides);
     $I->assertEquals(5, count($ids));
     for ($i = 0; $i < count($ids); $i++) {
         foreach ($overrides as $key => $value) {
             $I->seeInDatabase($I->grabCommentsTableName(), ['comment_post_ID' => $postId, 'comment_ID' => $ids[$i], $key => str_replace('{{n}}', $i, $value)]);
         }
     }
 }
開發者ID:lucatume,項目名稱:wp-browser,代碼行數:16,代碼來源:WPDbCommentCest.php

示例8: testTheMinimumPasswordLength

 /**
  * Checks that the minimum password requirement is working as expected (IS-21).
  *
  * @param FunctionalTester $I
  */
 public function testTheMinimumPasswordLength(FunctionalTester $I)
 {
     // assert that the property exists
     $I->assertTrue(isset(Yii::$app->user->minPasswordLength));
     // assert that the default value of the property is 6
     $I->assertEquals(6, Yii::$app->user->minPasswordLength);
     // try to register a user with a shorter password
     $registerPage = RegisterPage::openBy($I);
     $registerPage->register(Commons::TEST_EMAIL, '12345');
     // it must fail
     $I->see('Password should contain at least 6 characters.');
     $I->dontSeeRecord(User::className(), ['email' => Commons::TEST_EMAIL]);
     // try to register a user with a correct password length
     $registerPage->register(Commons::TEST_EMAIL, 'Innologica!23');
     // it must pass
     $I->seeRecord(User::className(), ['email' => Commons::TEST_EMAIL]);
 }
開發者ID:nkostadinov,項目名稱:yii2-user,代碼行數:22,代碼來源:AdvancedUserCest.php

示例9: FunctionalTester

<?php

$I = new FunctionalTester($scenario);
$rabman = new \Rabman\ResourceFactory(\Codeception\Util\Fixtures::get('rabman-opt'));
$items = $rabman->nodes()->columns(['exchange_types.name']);
$count = count($items);
$I->assertTrue($count > 0);
$expected = [['name' => 'direct'], ['name' => 'headers'], ['name' => 'topic'], ['name' => 'fanout']];
$I->assertEquals($expected, $items[0]['exchange_types']);
開發者ID:imega,項目名稱:rabbitmq-management-api,代碼行數:9,代碼來源:NodeCept.php

示例10: FunctionalTester

<?php

$I = new FunctionalTester($scenario);
$rabman = new \Rabman\ResourceFactory(\Codeception\Util\Fixtures::get('rabman-opt'));
$items = $rabman->extensions();
$count = count($items);
$I->assertTrue($count > 0);
$expected = ['javascript' => 'dispatcher.js'];
$I->assertEquals($expected, $items[0]);
開發者ID:imega,項目名稱:rabbitmq-management-api,代碼行數:9,代碼來源:ExtensionCept.php

示例11: it_should_allow_grabbing_a_site_transient_while_using_secondary_blog

 /**
  * @test
  * it should allow grabbing a site transient while using secondary blog
  */
 public function it_should_allow_grabbing_a_site_transient_while_using_secondary_blog(FunctionalTester $I)
 {
     $table = $I->grabPrefixedTableNameFor('options');
     $I->haveInDatabase($table, ['option_name' => '_site_transient_key', 'option_value' => 'foo']);
     $I->useBlog(2);
     $value = $I->grabSiteTransientFromDatabase('key');
     $I->assertEquals('foo', $value);
 }
開發者ID:LeRondPoint,項目名稱:wp-browser,代碼行數:12,代碼來源:WPDbOptionCest.php

示例12: testGetConceptPropertiesArray

    public function testGetConceptPropertiesArray(FunctionalTester $I)
    {
        $concept = ConceptPeer::retrieveByPK(727);
        $propertyArray = jsonldService::getConceptPropertyArray($concept);
        $I->assertEquals(json_encode($propertyArray,
                                     JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT), '{
    "@id": "http://rdaregistry.info/termList/AspectRatio/1001",
    "@type": "Concept",
    "api": "http://api.metadataregistry.org/concepts/727",
    "inScheme": "http://rdaregistry.info/termList/AspectRatio/",
    "status": "Published",
    "prefLabel": {
        "en": "full screen",
        "de": "Vollbild",
        "fr": "plein écran",
        "es": "pantalla completa",
        "zh": "全屏"
    },
    "scopeNote": {
        "en": "Use for standard format, i.e., 1.33:1 or 4:3."
    },
    "definition": {
        "en": "Aspect ratio for a moving image resource of less than 1.5:1.",
        "de": "Bildformat einer Bewegtbildressource von weniger als 1.5:1.",
        "fr": "Format de l’image d’une ressource d’images animées inférieur à 1,5:1.",
        "es": "Proporción dimensional de un recurso de imagen en movimiento menor que 1.5:1.",
        "zh": "動態圖像資源的寬高比小於1.5:1。"
    },
    "ToolkitLabel": {
        "en": "full screen",
        "fr": "plein écran",
        "de": "Vollbild",
        "es": "pantalla completa",
        "zh": "全屏"
    },
    "ToolkitDefinition": {
        "en": "Aspect ratio for a moving image resource of less than 1.5:1.",
        "fr": "Format de l’image d’une ressource d’images animées inférieur à 1,5:1.",
        "de": "Bildformat einer Bewegtbildressource von weniger als 1.5:1.",
        "es": "Proporción dimensional de un recurso de imagen en movimiento menor que 1.5:1.",
        "zh": "動態圖像資源的寬高比小於1.5:1。"
    },
    "altLabel": {
        "en": [
            "full-screen",
            "full-screen",
            "fullscreen",
            "full-screen"
        ]
    }
}');
    }
開發者ID:jonphipps,項目名稱:Metadata-Registry,代碼行數:52,代碼來源:jsonldServiceCest.php

示例13: it_should_allow_grabbing_a_user_unique_meta

 /**
  * @test
  * it should allow grabbing a user unique meta
  */
 public function it_should_allow_grabbing_a_user_unique_meta(FunctionalTester $I)
 {
     $I->haveUserInDatabase('Luca');
     $userId = $I->grabUserIdFromDatabase('Luca');
     $I->haveUserMetaInDatabase($userId, 'some_key', 'some_value');
     $meta = $I->grabUserMetaFromDatabase($userId, 'some_key');
     $I->assertEquals(1, count($meta));
     $I->assertEquals('some_value', $meta[0]);
 }
開發者ID:lucatume,項目名稱:wp-browser,代碼行數:13,代碼來源:WPDbUserCest.php

示例14: FunctionalTester

<?php

$fixture = (require 'fixtures/definition.php');
$I = new FunctionalTester($scenario);
$rabman = new \Rabman\ResourceFactory(\Codeception\Util\Fixtures::get('rabman-opt'));
$items = $rabman->definitions();
$count = count($items);
$I->assertTrue($count > 0);
$rabman->definitions()->vhost()->create(json_decode($fixture, true));
$items = $rabman->exchanges('second.exchange.5')->columns(['name']);
count($items);
$I->assertTrue($count > 0);
$I->assertEquals('second.exchange.5', $items[0]['name']);
開發者ID:imega,項目名稱:rabbitmq-management-api,代碼行數:13,代碼來源:DefinitionCept.php

示例15: redirectUrl

 public function redirectUrl(FunctionalTester $I)
 {
     $port = $I->openProxy();
     $I->assertNotNull($port, "`{$port}` is not a valid port");
     $rep = $I->redirectUrl('http://testdomain.url/', 'http://codeception.com/');
     $I->assertTrue($rep);
     $I->startHar('codeception');
     Requests::get('http://testdomain.url/', [], ['proxy' => "127.0.0.1:{$port}"]);
     $har = $I->getHar();
     $I->assertEquals('http://codeception.com/', $har['log']['entries'][0]['request']['url']);
     $I->closeProxy();
 }
開發者ID:edno,項目名稱:codeception-browsermob,代碼行數:12,代碼來源:BrowserMobProxyCest.php


注:本文中的FunctionalTester::assertEquals方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。