assertNotNull($changeset); assert($changeset !== null); // for typechecker $this->assertTrue($changeset->isValid()); $changeset = ShipItSubmoduleFilter::useSubmoduleCommitFromTextFile( $changeset, 'fbcode/hphp/facebook/third-party-rev.txt', 'third-party', ); $this->assertSame(1, $changeset->getDiffs()->keys()->count()); $change = ($changeset->getDiffs()->filter( $diff ==> $diff['path'] === 'third-party' )->firstValue() ?? [])['body']; $this->assertNotEmpty($change); $this->assertContains('--- a/third-party', $change); $this->assertContains('+++ b/third-party', $change); $old_pos = strpos($change, '6d9dffd0233c53bb83e4daf5475067073df9cdca'); $new_pos = strpos($change, 'ae031dcc9594163f5b0c35e7026563f1c8372595'); $this->assertNotFalse($old_pos); $this->assertNotFalse($new_pos); $this->assertGreaterThan($old_pos, $new_pos); } }