Christopher Johnson (WMDE) has uploaded a new change for review.
https://gerrit.wikimedia.org/r/221085
Change subject: updates tests
......................................................................
updates tests
Change-Id: Icf710131a71c95f7745ddef617225cbe18ea31b5
---
M src/tests/Autoloader.php
M src/tests/DateIterator.php
M src/tests/SprintApplicationTest.php
M src/tests/SprintControllerTest.php
M src/tests/SprintQueryTest.php
M src/tests/SprintStatsTest.php
M src/tests/bootstrap.php
M src/tests/phpunit.xml
8 files changed, 12 insertions(+), 91 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/phabricator/extensions/Sprint
refs/changes/85/221085/1
diff --git a/src/tests/Autoloader.php b/src/tests/Autoloader.php
index 87a3d2d..1d58bee 100644
--- a/src/tests/Autoloader.php
+++ b/src/tests/Autoloader.php
@@ -2,7 +2,7 @@
class AutoLoader {
- static private $classNames = array();
+ private static $classNames = array();
/**
* Store the filename (sans extension) & full path of all ".php" files found
@@ -18,7 +18,7 @@
} else if (substr($file->getFilename(), -4) === '.php') {
// save the class name / path of a .php file found
$className = substr($file->getFilename(), 0, -4);
- AutoLoader::registerClass($className, $file->getPathname());
+ self::registerClass($className, $file->getPathname());
}
}
}
@@ -28,16 +28,15 @@
* @param string $fileName
*/
public static function registerClass($className, $fileName) {
- AutoLoader::$classNames[$className] = $fileName;
+ self::$classNames[$className] = $fileName;
}
public static function loadClass($className) {
- if (isset(AutoLoader::$classNames[$className])) {
- require_once AutoLoader::$classNames[$className];
+ if (isset(self::$classNames[$className])) {
+ require_once self::$classNames[$className];
}
}
}
spl_autoload_register(array('AutoLoader', 'loadClass'));
-
diff --git a/src/tests/DateIterator.php b/src/tests/DateIterator.php
index c7342fc..64d6abd 100644
--- a/src/tests/DateIterator.php
+++ b/src/tests/DateIterator.php
@@ -35,4 +35,3 @@
}
}
-
diff --git a/src/tests/SprintApplicationTest.php
b/src/tests/SprintApplicationTest.php
index fa8c652..61716f8 100644
--- a/src/tests/SprintApplicationTest.php
+++ b/src/tests/SprintApplicationTest.php
@@ -31,70 +31,4 @@
$this->assertInstanceOf('BurndownActionMenuEventListener',
$eventlistener[0]);
}
- public function testgetRoutes() {
- $burndown_application = new SprintApplication();
- $routes = $burndown_application->getRoutes();
- $assertion = array(
- // this is the default application route controller
- '/project/sprint/' => array(
- '' => 'SprintListController',
- // these are forked controllers for the Sprint Board
- 'board/(?P<projectID>[1-9]\d*)/' => array(
- 'edit/(?:(?P<id>\d+)/)?'
- => 'SprintBoardColumnEditController',
- 'hide/(?:(?P<id>\d+)/)?'
- => 'SprintBoardColumnHideController',
- 'column/(?:(?P<id>\d+)/)?'
- => 'SprintBoardColumnDetailController',
- 'import/'
- => 'SprintBoardImportController',
- 'reorder/'
- => 'SprintBoardReorderController',
- ),
- // these allow task creation and editing from a Sprint Board
- 'board/task/edit/(?P<id>[1-9]\d*)/'
- => 'SprintBoardTaskEditController',
- 'board/task/create/'
- => 'SprintBoardTaskEditController',
- 'board/batch/'
- => 'SprintBoardBatchEditController',
- // these are for board filters and column queries
- 'board/(?P<id>[1-9]\d*)/'.
- '(?P<filter>filter/)?'.
- '(?:query/(?P<queryKey>[^/]+)/)?'
- => 'SprintBoardViewController',
- // these are native Sprint application controllers
- 'burn/(?P<id>\d+)/' => 'SprintDataViewController',
- 'profile/(?P<id>[1-9]\d*)/'
- => 'SprintProjectProfileController',
- 'report/list/' => 'SprintListController',
- 'report/(?:(?P<view>\w+)/)?' => 'SprintReportController',
- 'view/(?P<id>\d+)/' => 'SprintDataViewController',
- // all routes following point to default controllers
- 'archive/(?P<id>[1-9]\d*)/'
- => 'PhabricatorProjectArchiveController',
- 'details/(?P<id>[1-9]\d*)/'
- => 'PhabricatorProjectEditDetailsController',
- 'feed/(?P<id>[1-9]\d*)/'
- => 'PhabricatorProjectFeedController',
- 'icon/(?P<id>[1-9]\d*)/'
- => 'PhabricatorProjectEditIconController',
- 'members/(?P<id>[1-9]\d*)/'
- => 'PhabricatorProjectMembersEditController',
- 'members/(?P<id>[1-9]\d*)/remove/'
- => 'PhabricatorProjectMembersRemoveController',
- 'move/(?P<id>[1-9]\d*)/' => 'SprintBoardMoveController',
- 'picture/(?P<id>[1-9]\d*)/'
- => 'PhabricatorProjectEditPictureController',
- 'update/(?P<id>[1-9]\d*)/(?P<action>[^/]+)/'
- => 'PhabricatorProjectUpdateController',
- ),
- // primary tag route override
- '/tag/' => array(
- '(?P<slug>[^/]+)/' => 'SprintProjectViewController',
- '(?P<slug>[^/]+)/board/' => 'SprintBoardViewController',
- ),
- );
- $this->assertEquals($assertion, $routes);
- }
}
diff --git a/src/tests/SprintControllerTest.php
b/src/tests/SprintControllerTest.php
index 7a0a559..62aa372 100644
--- a/src/tests/SprintControllerTest.php
+++ b/src/tests/SprintControllerTest.php
@@ -7,14 +7,6 @@
$this->assertTrue($stub->shouldAllowPublic());
}
- public function testbuildSideNavView() {
- $stub = $this->getMockForAbstractClass('SprintController');
- $user = $this->generateNewTestUser();
- $uri = new PhutilURI('/project/sprint/');
- $nav = $stub->buildSideNavView($for_app = false, $user, $uri);
- $this->assertInstanceOf('AphrontSideNavFilterView', $nav);
- }
-
public function testgetSprintDataView() {
$projectobj = new PhabricatorProject();
$viewer = $this->generateNewTestUser();
diff --git a/src/tests/SprintQueryTest.php b/src/tests/SprintQueryTest.php
index ec0d678..2cbb7b8 100644
--- a/src/tests/SprintQueryTest.php
+++ b/src/tests/SprintQueryTest.php
@@ -53,4 +53,3 @@
// }
}
-
diff --git a/src/tests/SprintStatsTest.php b/src/tests/SprintStatsTest.php
index 6195797..115fc69 100644
--- a/src/tests/SprintStatsTest.php
+++ b/src/tests/SprintStatsTest.php
@@ -34,7 +34,7 @@
* @param string $now
*/
public function short_date($now) {
- $short = array($now + $this->short_interval,$now +
$this->short_interval*2,$now + $this->short_interval*3, $now +
$this->short_interval*4, $now + $this->short_interval*5);
+ $short = array($now + $this->short_interval, $now + $this->short_interval
* 2, $now + $this->short_interval * 3, $now + $this->short_interval * 4, $now +
$this->short_interval * 5);
return $short;
}
@@ -42,7 +42,7 @@
* @param string $now
*/
public function medium_date($now) {
- $medium = array($now + $this->day_interval,$now + $this->day_interval*2,
$now + $this->day_interval*3,$now + $this->day_interval*4, $now +
$this->day_interval*5);
+ $medium = array($now + $this->day_interval, $now + $this->day_interval *
2, $now + $this->day_interval * 3, $now + $this->day_interval * 4, $now +
$this->day_interval * 5);
return $medium;
}
@@ -50,7 +50,7 @@
* @param string $now
*/
public function long_date($now) {
- $long = array($now + $this->week_interval,$now + $this->week_interval*2,
$now + $this->week_interval*4,$this->multi_month_interval,
$this->year_interval);
+ $long = array($now + $this->week_interval, $now + $this->week_interval *
2, $now + $this->week_interval * 4, $this->multi_month_interval,
$this->year_interval);
return $long;
}
@@ -170,4 +170,3 @@
$this->assertEquals($series, $data[0]);
}
}
-
diff --git a/src/tests/bootstrap.php b/src/tests/bootstrap.php
index 0f0ed8d..944f4fd 100644
--- a/src/tests/bootstrap.php
+++ b/src/tests/bootstrap.php
@@ -3,10 +3,10 @@
$root = dirname(dirname(__FILE__));
require_once $root.'/constants/SprintConstants.php';
require_once $root.'/tests/Autoloader.php';
-require_once SprintConstants::LIBPHUTIL_ROOT_DIR .
'/src/internationalization/pht.php';
-require_once SprintConstants::LIBPHUTIL_ROOT_DIR . '/src/utils/utils.php';
-require_once SprintConstants::LIBPHUTIL_ROOT_DIR . '/src/moduleutils/core.php';
-require_once SprintConstants::LIBPHUTIL_ROOT_DIR .
'/src/moduleutils/moduleutils.php';
+require_once
SprintConstants::LIBPHUTIL_ROOT_DIR.'/src/internationalization/pht.php';
+require_once SprintConstants::LIBPHUTIL_ROOT_DIR.'/src/utils/utils.php';
+require_once SprintConstants::LIBPHUTIL_ROOT_DIR.'/src/moduleutils/core.php';
+require_once
SprintConstants::LIBPHUTIL_ROOT_DIR.'/src/moduleutils/moduleutils.php';
require_once SprintConstants::LIBPHUTIL_ROOT_DIR.'/src/markup/render.php';
AutoLoader::registerDirectory($root);
AutoLoader::registerDirectory(SprintConstants::PHABRICATOR_ROOT_DIR);
diff --git a/src/tests/phpunit.xml b/src/tests/phpunit.xml
index 23b92ed..8d18870 100644
--- a/src/tests/phpunit.xml
+++ b/src/tests/phpunit.xml
@@ -31,4 +31,3 @@
<log type="testdox-text" target="/tmp/testdox.txt"/>
</logging>
</phpunit>
-
--
To view, visit https://gerrit.wikimedia.org/r/221085
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Icf710131a71c95f7745ddef617225cbe18ea31b5
Gerrit-PatchSet: 1
Gerrit-Project: phabricator/extensions/Sprint
Gerrit-Branch: master
Gerrit-Owner: Christopher Johnson (WMDE) <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits