From 66cb7d07935f93105b6a890260a82505711e62b5 Mon Sep 17 00:00:00 2001 From: Daniel Kraus Date: Tue, 29 Aug 2017 14:48:20 +0200 Subject: [PATCH] Add license comments to tests. --- tests/phpunit/ConfigTest.php | 21 +++++++++++++++++++++ tests/phpunit/ExtensionTest.php | 21 +++++++++++++++++++++ tests/phpunit/LinkerTest.php | 22 +++++++++++++++++++++- tests/phpunit/SplitterTest.php | 23 +++++++++++++++++++++++ tests/phpunit/TargetTest.php | 21 +++++++++++++++++++++ tests/phpunit/TargetsTest.php | 21 +++++++++++++++++++++ tests/phpunit/TestCase.php | 27 +++++++++++++++++++++++++-- 7 files changed, 153 insertions(+), 3 deletions(-) diff --git a/tests/phpunit/ConfigTest.php b/tests/phpunit/ConfigTest.php index 0d4b651..9a2877f 100644 --- a/tests/phpunit/ConfigTest.php +++ b/tests/phpunit/ConfigTest.php @@ -1,4 +1,25 @@ ('bovender') + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. + * + * @author Daniel Kraus + */ + /** * Tests the LinkTitles\Config class. * diff --git a/tests/phpunit/ExtensionTest.php b/tests/phpunit/ExtensionTest.php index 00b8ed8..da98678 100644 --- a/tests/phpunit/ExtensionTest.php +++ b/tests/phpunit/ExtensionTest.php @@ -1,4 +1,25 @@ ('bovender') + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. + * + * @author Daniel Kraus + */ + /** * @group bovender * @group Database diff --git a/tests/phpunit/LinkerTest.php b/tests/phpunit/LinkerTest.php index b221910..5b9a97b 100644 --- a/tests/phpunit/LinkerTest.php +++ b/tests/phpunit/LinkerTest.php @@ -1,4 +1,25 @@ ('bovender') + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. + * + * @author Daniel Kraus + */ + /** * Unit tests for the LinkTitles\Linker class. * @@ -8,7 +29,6 @@ * Ideally the test classes should be namespaced, but when you do that, they * will no longer be automatically discovered. * - * @group bovender * @group Database */ class LinkTitlesLinkerTest extends LinkTitles\TestCase { diff --git a/tests/phpunit/SplitterTest.php b/tests/phpunit/SplitterTest.php index fcb1a7d..5ebfc69 100644 --- a/tests/phpunit/SplitterTest.php +++ b/tests/phpunit/SplitterTest.php @@ -1,5 +1,28 @@ ('bovender') + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. + * + * @author Daniel Kraus + */ + +/** + * Tests the LinKTitles\Splitter class. + * * @group bovender */ class SplitterTest extends MediaWikiTestCase { diff --git a/tests/phpunit/TargetTest.php b/tests/phpunit/TargetTest.php index 5cc9691..2c08f11 100644 --- a/tests/phpunit/TargetTest.php +++ b/tests/phpunit/TargetTest.php @@ -1,4 +1,25 @@ ('bovender') + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. + * + * @author Daniel Kraus + */ + /** * @group bovender */ diff --git a/tests/phpunit/TargetsTest.php b/tests/phpunit/TargetsTest.php index 820af17..0638cee 100644 --- a/tests/phpunit/TargetsTest.php +++ b/tests/phpunit/TargetsTest.php @@ -1,4 +1,25 @@ ('bovender') + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. + * + * @author Daniel Kraus + */ + /** * Tests the LinkTitles\Targets class. * diff --git a/tests/phpunit/TestCase.php b/tests/phpunit/TestCase.php index 11f7743..fb4f667 100644 --- a/tests/phpunit/TestCase.php +++ b/tests/phpunit/TestCase.php @@ -1,17 +1,40 @@ ('bovender') + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. + * + * @author Daniel Kraus + */ namespace LinkTitles; abstract class TestCase extends \MediaWikiTestCase { protected function setUp() { parent::setUp(); - $this->insertPage( 'link target', 'This page serves as a link target' ); - Targets::invalidate(); // force re-querying the pages table } protected function tearDown() { parent::tearDown(); } + public function addDBDataOnce() { + $this->insertPage( 'link target', 'This page serves as a link target' ); + Targets::invalidate(); // force re-querying the pages table + } + protected function getPageText( \WikiPage $page ) { $content = $page->getContent(); return $page->getContentHandler()->serializeContent( $content );