jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/400137 )
Change subject: Added a unit test to check that the main page exists ...................................................................... Added a unit test to check that the main page exists Bug: T183632 Change-Id: If424bfd9b820fa93b71b1d6f892fa5941d6d086c --- M tests/specials/SpecialNewsletterCreateTest.php 1 file changed, 22 insertions(+), 0 deletions(-) Approvals: 01tonythomas: Looks good to me, approved jenkins-bot: Verified diff --git a/tests/specials/SpecialNewsletterCreateTest.php b/tests/specials/SpecialNewsletterCreateTest.php index a928437..057796c 100644 --- a/tests/specials/SpecialNewsletterCreateTest.php +++ b/tests/specials/SpecialNewsletterCreateTest.php @@ -19,4 +19,26 @@ $this->executeSpecialPage( '', null, null, $user->getUser() ); $this->assertTrue( true ); } + + public function testCreateNewsletterMainPageExists() { + $input = [ + 'name' => 'Test Newsletter', + 'description' => 'This is a test newsletter that should return an error for a bad main page.', + 'mainpage' => Title::newFromText( 'BdaMianPage' )->getBaseText() + ]; + + // Mock submission of bad main page + $res = $this->newSpecialPage()->onSubmit( $input ); + + // The main page is nonexistent + $this->assertEquals( + $res->getMessage()->getKey(), 'newsletter-mainpage-non-existent' + ); + + // The newsletter was not created + $store = NewsletterStore::getDefaultInstance(); + $this->assertNull( + $store->getNewsletterFromName( 'Test Newsletter' ) + ); + } } -- To view, visit https://gerrit.wikimedia.org/r/400137 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: If424bfd9b820fa93b71b1d6f892fa5941d6d086c Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Newsletter Gerrit-Branch: master Gerrit-Owner: Ryan10145 <chang.ryan10...@gmail.com> Gerrit-Reviewer: 01tonythomas <01tonytho...@gmail.com> Gerrit-Reviewer: Addshore <addshorew...@gmail.com> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits