Verified Commit d433d966 authored by quietone's avatar quietone
Browse files

Issue #3458426 by mstrelan, catch, smustgrave: Add int return typehints to...

Issue #3458426 by mstrelan, catch, smustgrave: Add int return typehints to protected test helper methods
parent aeef5cd6
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -255,7 +255,7 @@ protected function assertSourceAttributeSame(string $attribute, ?string $value):
   * @return int
   *   The size of the bytes transferred.
   */
  protected function getLastPreviewRequestTransferSize() {
  protected function getLastPreviewRequestTransferSize(): int {
    $javascript = <<<JS
(function(){
  return window.performance
+1 −1
Original line number Diff line number Diff line
@@ -159,7 +159,7 @@ protected function assertAnnounceLeaveEditMode(): void {
   * @return int
   *   The number of tabbable elements.
   */
  protected function getTabbableElementsCount() {
  protected function getTabbableElementsCount(): int {
    // Mark all tabbable elements.
    $this->getSession()->executeScript("jQuery(window.tabbable.tabbable(document.body)).attr('data-marked', '');");
    // Count all marked elements.
+1 −1
Original line number Diff line number Diff line
@@ -119,7 +119,7 @@ protected function setSiteTimezone($timezone) {
   * @return int
   *   Unix timestamp.
   */
  protected function getUTCEquivalentOfUserNowAsTimestamp() {
  protected function getUTCEquivalentOfUserNowAsTimestamp(): int {
    $user_now = new DateTimePlus('now', new \DateTimeZone(date_default_timezone_get()));
    $utc_equivalent = new DateTimePlus($user_now->format('Y-m-d H:i:s'), new \DateTimeZone(DateTimeItemInterface::STORAGE_TIMEZONE));

+1 −1
Original line number Diff line number Diff line
@@ -83,7 +83,7 @@ public function testInvalidPlaceholders(): void {
   * @return int
   *   Number of new watchdog entries.
   */
  private function runCron() {
  private function runCron(): int {
    $connection = Database::getConnection();
    // Get last ID to compare against; log entries get deleted, so we can't
    // reliably add the number of newly created log entries to the current count
+1 −1
Original line number Diff line number Diff line
@@ -62,7 +62,7 @@ protected function setUp(): void {
   * @return int
   *   Total usage count.
   */
  protected function sumUsages($usage) {
  protected function sumUsages($usage): int {
    $count = 0;
    foreach ($usage as $module) {
      foreach ($module as $entity_type) {
Loading