Verified Commit 6bbb08f9 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3210064 by mfb, TanujJain-TJ, maosmurf, smustgrave, xjm,...

Issue #3210064 by mfb, TanujJain-TJ, maosmurf, smustgrave, xjm, samuel.mortenson: EntityChangedTrait return type mismatch
parent 21d40b75
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -26,11 +26,13 @@ public function getChangedTimeAcrossTranslations() {
  /**
   * Gets the timestamp of the last entity change for the current translation.
   *
   * @return int
   *   The timestamp of the last entity save operation.
   * @return int|null
   *   The timestamp of the last entity save operation. Some entities allow a
   *   NULL value indicating the changed time is unknown.
   */
  public function getChangedTime() {
    return $this->get('changed')->value;
    $value = $this->get('changed')->value;
    return isset($value) ? (int) $value : NULL;
  }

  /**
+4 −4
Original line number Diff line number Diff line
@@ -69,7 +69,7 @@ public function testMigration() {
    $this->assertInstanceOf(Comment::class, $comment);
    $this->assertSame('Subject field in English', $comment->getSubject());
    $this->assertSame('1421727536', $comment->getCreatedTime());
    $this->assertSame('1421727536', $comment->getChangedTime());
    $this->assertSame(1421727536, $comment->getChangedTime());
    $this->assertTrue($comment->isPublished());
    $this->assertSame('admin', $comment->getAuthorName());
    $this->assertSame('admin@local.host', $comment->getAuthorEmail());
@@ -111,7 +111,7 @@ public function testMigration() {
    $this->assertInstanceOf(Comment::class, $comment);
    $this->assertSame('Comment without language', $comment->getSubject());
    $this->assertSame('1426781880', $comment->getCreatedTime());
    $this->assertSame('1426781880', $comment->getChangedTime());
    $this->assertSame(1426781880, $comment->getChangedTime());
    $this->assertTrue($comment->isPublished());
    $this->assertSame('Bob', $comment->getAuthorName());
    $this->assertSame('bob@local.host', $comment->getAuthorEmail());
@@ -147,7 +147,7 @@ public function testMigration() {
    $this->assertSame('en', $metadata_fr->getSource());
    $this->assertSame('1', $metadata_fr->getAuthor()->uid->value);
    $this->assertSame('1531837764', $metadata_fr->getCreatedTime());
    $this->assertSame('1531837764', $metadata_fr->getChangedTime());
    $this->assertSame(1531837764, $metadata_fr->getChangedTime());
    $this->assertFalse($metadata_fr->isOutdated());

    // Test that the Icelandic translation metadata is correctly migrated.
@@ -156,7 +156,7 @@ public function testMigration() {
    $this->assertSame('en', $metadata_is->getSource());
    $this->assertSame('2', $metadata_is->getAuthor()->uid->value);
    $this->assertSame('1531838064', $metadata_is->getCreatedTime());
    $this->assertSame('1531838064', $metadata_is->getChangedTime());
    $this->assertSame(1531838064, $metadata_is->getChangedTime());
    $this->assertTrue($metadata_is->isOutdated());
  }

+1 −1
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@ protected function getFileMigrationInfo() {
   * Tests that all expected files are migrated.
   */
  public function testFileMigration() {
    $this->assertEntity(1, 'cube.jpeg', 'public://cube.jpeg', 'image/jpeg', 3620, 1421727515, '1421727515', '1');
    $this->assertEntity(1, 'cube.jpeg', 'public://cube.jpeg', 'image/jpeg', 3620, 1421727515, 1421727515, '1');
    // Ensure temporary file was not migrated.
    $this->assertNull(File::load(4));
  }
+1 −1
Original line number Diff line number Diff line
@@ -53,7 +53,7 @@ public function register(ContainerBuilder $container) {
   * Tests that all expected files are migrated.
   */
  public function testFileMigration() {
    $this->assertEntity(3, 'Babylon5.txt', 'private://Babylon5.txt', 'text/plain', 3, 1486104045, '1486104045', '1');
    $this->assertEntity(3, 'Babylon5.txt', 'private://Babylon5.txt', 'text/plain', 3, 1486104045, 1486104045, '1');
  }

}
+30 −30
Original line number Diff line number Diff line
@@ -1052,210 +1052,210 @@ protected function expectedRevisionEntityData() {
          [
            'log' => NULL,
            'created' => '1390095702',
            'changed' => '1390095702',
            'changed' => 1390095702,
          ],
        // Node 2, revision 3, und.
        1 =>
          [
            'log' => NULL,
            'created' => '1420718386',
            'changed' => '1420718386',
            'changed' => 1420718386,
          ],
        // Node 3, revision 4, und.
        2 =>
          [
            'log' => NULL,
            'created' => '1390095701',
            'changed' => '1390095701',
            'changed' => 1390095701,
          ],
        // Node 1, revision 5, und.
        3 =>
          [
            'log' => 'modified rev 2',
            'created' => '1390095703',
            'changed' => '1390095703',
            'changed' => 1390095703,
          ],
        // Node 4, revision 6, und.
        4 =>
          [
            'log' => NULL,
            'created' => '1390095701',
            'changed' => '1390095701',
            'changed' => 1390095701,
          ],
        // Node 5, revision 7, und.
        5 =>
          [
            'log' => NULL,
            'created' => '1390095701',
            'changed' => '1390095701',
            'changed' => 1390095701,
          ],
        // Node 6, revision 8, und.
        6 =>
          [
            'log' => NULL,
            'created' => '1390095701',
            'changed' => '1390095701',
            'changed' => 1390095701,
          ],
        // Node 7, revision 9, und.
        7 =>
          [
            'log' => NULL,
            'created' => '1390095701',
            'changed' => '1390095701',
            'changed' => 1390095701,
          ],
        // Node 8, revision 10, und.
        8 =>
          [
            'log' => NULL,
            'created' => '1390095701',
            'changed' => '1390095701',
            'changed' => 1390095701,
          ],
        // Node 9, revision 11, und.
        9 =>
          [
            'log' => NULL,
            'created' => '1390095701',
            'changed' => '1390095701',
            'changed' => 1390095701,
          ],
        // Node 9, revision 12, und.
        10 =>
          [
            'log' => NULL,
            'created' => '1444671588',
            'changed' => '1444671588',
            'changed' => 1444671588,
          ],
        // Node 10, revision 13, en.
        11 =>
          [
            'log' => NULL,
            'created' => '1444238808',
            'changed' => '1444238808',
            'changed' => 1444238808,
          ],
        // Node 10, revision 14, en.
        12 =>
          [
            'log' => NULL,
            'created' => '1444239050',
            'changed' => '1444238808',
            'changed' => 1444238808,
          ],
        // Node 10, revision 14, fr.
        13 =>
          [
            'log' => NULL,
            'created' => '1444239050',
            'changed' => '1444239050',
            'changed' => 1444239050,
          ],
        // Node 12, revision 15, zu.
        14 =>
          [
            'log' => NULL,
            'created' => '1444238808',
            'changed' => '1444238808',
            'changed' => 1444238808,
          ],
        // Node 12, revision 16, en.
        15 =>
          [
            'log' => NULL,
            'created' => '1444239050',
            'changed' => '1444239050',
            'changed' => 1444239050,
          ],
        // Node 12, revision 16, zu.
        16 =>
          [
            'log' => NULL,
            'created' => '1444239050',
            'changed' => '1444238808',
            'changed' => 1444238808,
          ],
        // Node 14, revision 17, und.
        17 =>
          [
            'log' => NULL,
            'created' => '1493066668',
            'changed' => '1493066668',
            'changed' => 1493066668,
          ],
        // Node 15, revision 18, und.
        18 =>
          [
            'log' => NULL,
            'created' => '1493066677',
            'changed' => '1493066677',
            'changed' => 1493066677,
          ],
        // Node 16, revision 19, und.
        19 =>
          [
            'log' => NULL,
            'created' => '1493066684',
            'changed' => '1493066684',
            'changed' => 1493066684,
          ],
        // Node 17, revision 20, und.
        20 =>
          [
            'log' => NULL,
            'created' => '1493066693',
            'changed' => '1493066693',
            'changed' => 1493066693,
          ],
        // Node 18, revision 21, und.
        21 =>
          [
            'log' => NULL,
            'created' => '1494966544',
            'changed' => '1494966544',
            'changed' => 1494966544,
          ],
        // Node 19, revision 22, und.
        22 =>
          [
            'log' => NULL,
            'created' => '1501955771',
            'changed' => '1501955771',
            'changed' => 1501955771,
          ],
        // Node 12, revision 23, en.
        23 =>
          [
            'log' => NULL,
            'created' => '1520613305',
            'changed' => '1444239050',
            'changed' => 1444239050,
          ],
        // Node 12, revision 23, fr.
        24 =>
          [
            'log' => NULL,
            'created' => '1520613305',
            'changed' => '1520613305',
            'changed' => 1520613305,
          ],
        // Node 12, revision 23, zu.
        25 =>
          [
            'log' => NULL,
            'created' => '1520613305',
            'changed' => '1444238808',
            'changed' => 1444238808,
          ],
        // Node 1, revision 2001, und.
        26 =>
          [
            'log' => 'modified rev 3',
            'created' => '1420861423',
            'changed' => '1420861423',
            'changed' => 1420861423,
          ],
        // Node 21, revision 2002, en.
        27 =>
          [
            'log' => NULL,
            'created' => '1534014650',
            'changed' => '1534014650',
            'changed' => 1534014650,
          ],
        // Node 21, revision 2003, en.
        28 =>
          [
            'log' => NULL,
            'created' => '1534014687',
            'changed' => '1534014650',
            'changed' => 1534014650,
          ],
        // Node 21, revision 2003, fr.
        29 =>
          [
            'log' => NULL,
            'created' => '1534014687',
            'changed' => '1534014687',
            'changed' => 1534014687,
          ],
      ],
    ];
Loading