当前位置: 首页>>代码示例>>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;未经允许,请勿转载。