Commit 40a5bd7e authored by catch's avatar catch
Browse files

Issue #3126965 by jungle, quietone, longwave, mondrake, dww: Replace assert*...

Issue #3126965 by jungle, quietone, longwave, mondrake, dww: Replace assert* involving count() and an integer literal with assertCount()
parent 9674c99b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -72,7 +72,7 @@ public function testOverviewPage() {

    $result = $this->xpath('//table/tbody/tr');
    // Check if the amount of feeds in the overview matches the amount created.
    $this->assertEqual(1, count($result), 'Created feed is found in the overview');
    $this->assertCount(1, $result, 'Created feed is found in the overview');
    // Check if the fields in the table match with what's expected.
    $link = $this->xpath('//table/tbody/tr//td[1]/a');
    $this->assertEquals($feed->label(), $link[0]->getText());
+2 −2
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@ public function testValidation() {
    ]);

    $violations = $feed->validate();
    $this->assertEqual(count($violations), 0);
    $this->assertCount(0, $violations);

    $feed->save();

@@ -53,7 +53,7 @@ public function testValidation() {

    $violations = $feed->validate();

    $this->assertEqual(count($violations), 2);
    $this->assertCount(2, $violations);
    $this->assertEqual($violations[0]->getPropertyPath(), 'title');
    $this->assertEqual($violations[0]->getMessage(), t('A feed named %value already exists. Enter a unique title.', [
      '%value' => $feed->label(),
+2 −2
Original line number Diff line number Diff line
@@ -93,7 +93,7 @@ public function testIPAddressValidation() {
    $query->fields('bip', ['iid']);
    $query->condition('bip.ip', $ip);
    $ip_count = $query->execute()->fetchAll();
    $this->assertEqual(1, count($ip_count));
    $this->assertCount(1, $ip_count);
    $ip = '';
    $banIp->banIp($ip);
    $banIp->banIp($ip);
@@ -101,7 +101,7 @@ public function testIPAddressValidation() {
    $query->fields('bip', ['iid']);
    $query->condition('bip.ip', $ip);
    $ip_count = $query->execute()->fetchAll();
    $this->assertEqual(1, count($ip_count));
    $this->assertCount(1, $ip_count);
  }

}
+1 −1
Original line number Diff line number Diff line
@@ -371,7 +371,7 @@ protected function assertBigPipePlaceholders(array $expected_big_pipe_placeholde
      $expected_placeholder_replacement = '<script type="application/vnd.drupal-ajax" data-big-pipe-replacement-for-placeholder-with-id="' . $big_pipe_placeholder_id . '">';
      $result = $this->xpath('//script[@data-big-pipe-replacement-for-placeholder-with-id=:id]', [':id' => Html::decodeEntities($big_pipe_placeholder_id)]);
      if ($expected_ajax_response === NULL) {
        $this->assertEqual(0, count($result));
        $this->assertCount(0, $result);
        $this->assertNoRaw($expected_placeholder_replacement);
        continue;
      }
+1 −1
Original line number Diff line number Diff line
@@ -54,7 +54,7 @@ public function testProcessPlaceholders(array $placeholders, $method, $route_mat
      }
    }
    else {
      $this->assertSame(0, count($processed_placeholders));
      $this->assertCount(0, $processed_placeholders);
    }
  }

Loading