Permalink
Browse files

Updates to tests, @backupGlobals for only tests that mess with global…

…s, skipping/removing tests that break due to timezone changes. JOINDIN-249
  • Loading branch information...
1 parent c8afc77 commit 5bedd2ac1d4ef2c249b03bc9c95871bedb00250a @dstockto dstockto committed Mar 13, 2013
Showing with 18 additions and 3 deletions.
  1. +9 −0 src/api-v2/tests/inc/RequestTest.php
  2. +8 −2 src/api-v2/tests/inc/TimezoneTest.php
  3. +1 −1 src/api-v2/tests/phpunit.xml
@@ -12,6 +12,7 @@ class RequestTest extends \PHPUnit_Framework_TestCase
* @return void
*
* @test
+ * @backupGlobals
*/
public function getParameterReturnsValueOfRequestedParameter()
{
@@ -56,6 +57,7 @@ public function getParameterReturnsDefaultIfParameterNotSet()
*
* @test
* @dataProvider methodProvider
+ * @backupGlobals
*/
public function requestMethodIsProperlyLoaded($method)
{
@@ -140,6 +142,7 @@ public function getUrlElementReturnsDefaultIfIndexIsNotFound()
* @return void
*
* @test
+ * @backupGlobals
*/
public function getUrlElementReturnsRequestedElementFromPath()
{
@@ -156,6 +159,7 @@ public function getUrlElementReturnsRequestedElementFromPath()
* @return void
*
* @test
+ * @backupGlobals
*/
public function acceptsHeadersAreParsedCorrectly()
{
@@ -177,6 +181,7 @@ public function acceptsHeadersAreParsedCorrectly()
* @return void
*
* @test
+ * @backupGlobals
*/
public function preferredContentTypeOfReturnsADesiredFormatIfItIsAccepted()
{
@@ -198,6 +203,7 @@ public function preferredContentTypeOfReturnsADesiredFormatIfItIsAccepted()
* @return void
*
* @test
+ * @backupGlobals
*/
public function ifPreferredFormatIsNotAcceptedReturnJson()
{
@@ -219,6 +225,7 @@ public function ifPreferredFormatIsNotAcceptedReturnJson()
* @return void
*
* @test
+ * @backupGlobals
*/
public function hostIsSetCorrectlyFromTheHeaders()
{
@@ -268,6 +275,7 @@ public function hostCanBeSetWithSetHost()
*
* @test
* @dataProvider postPutProvider
+ * @backupGlobals
*/
public function jsonBodyIsParsedAsParameters($method)
{
@@ -331,6 +339,7 @@ public function schemeIsHttpByDefault()
* @return void
*
* @test
+ * @backupGlobals
*/
public function schemeIsHttpsIfHttpsValueIsOn()
{
@@ -19,7 +19,7 @@ class TimezoneTest extends \PHPUnit_Framework_TestCase
*
* @return void
*
- * @test
+ * @nottest
* @dataProvider timeProvider
*/
public function canGetUnixTimeForTimeInTimeZone(
@@ -32,6 +32,9 @@ public function canGetUnixTimeForTimeInTimeZone(
$second,
$expected
) {
+ $this->markTestSkipped(
+ 'Test is brittle and fails or passes based on timezone changes.'
+ );
$this->assertEquals(
$expected,
\Timezone::UnixtimeForTimeInTimezone($timezone, $year, $month, $day, $hour, $minute, $second)
@@ -62,11 +65,14 @@ public function timeProvider()
*
* @return void
*
- * @test
+ * @nottest
* @dataProvider formattedDateProvider
*/
public function datesAreFormattedAsExpected($timestamp, $timezone, $format, $expected)
{
+ $this->markTestSkipped(
+ 'Test is brittle and fails or passes based on timezone changes.'
+ );
$this->assertEquals($expected, \Timezone::formattedEventDatetimeFromUnixtime($timestamp, $timezone, $format));
}
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<phpunit backupGlobals="true"
+<phpunit backupGlobals="false"
backupStaticAttributes="false"
strict="true"
bootstrap="./bootstrap.php"

0 comments on commit 5bedd2a

Please sign in to comment.