Skip to content

Fix PHPUnit Risky Tests #449

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tests/Parse/ParseACLTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@ public function testACLRequiresObjectId()
$this->fail('Exception should have thrown');
} catch (Exception $e) {
}
$this->assertTrue(true);
}

public function testIncludedObjectsGetACLs()
Expand Down
1 change: 1 addition & 0 deletions tests/Parse/ParseMemoryStorageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,6 @@ public function testSave()
{
// does nothing
self::$parseStorage->save();
$this->assertTrue(true);
}
}
4 changes: 4 additions & 0 deletions tests/Parse/ParseObjectTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public function testCreate()
$obj = ParseObject::create('TestObject');
$obj->set('test', 'test');
$obj->save();
$this->assertEquals($obj->get('test'), 'test');
}

public function testUpdate()
Expand Down Expand Up @@ -649,6 +650,7 @@ public function testManySaveAfterAFailure()
if ($exceptions != 3) {
$this->fail('Did not cause expected # of exceptions.');
}
$this->assertTrue(true);
}

public function testNewKeyIsDirtyAfterSave()
Expand Down Expand Up @@ -865,6 +867,7 @@ public function testArraySetAndAdd()
$obj->save();
$obj->add('arrayfield', ['c', 'd', 'e']);
$obj->save();
$this->assertEquals($obj->get('arrayfield'), ['a', 'b', 'c', 'd', 'e']);
}

public function testObjectIsDirty()
Expand Down Expand Up @@ -1443,6 +1446,7 @@ public function testDestroyingUnsaved()
{
$obj = new ParseObject('TestClass');
$obj->destroy();
$this->assertTrue(true);
}

public function testEncodeWithArray()
Expand Down
12 changes: 8 additions & 4 deletions tests/Parse/ParsePushTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,14 @@ public function testNoMasterKey()

public function testBasicPush()
{
ParsePush::send(
$response = ParsePush::send(
[
'channels' => [''],
'data' => ['alert' => 'sample message'],
],
true
);
$this->assertEquals($response['result'], 1);
}

/**
Expand Down Expand Up @@ -89,25 +90,27 @@ public function testPushToQuery()
{
$query = ParseInstallation::query();
$query->equalTo('key', 'value');
ParsePush::send(
$response = ParsePush::send(
[
'data' => ['alert' => 'iPhone 5 is out!'],
'where' => $query,
],
true
);
$this->assertEquals($response['result'], 1);
}

public function testPushToQueryWithoutWhere()
{
$query = ParseInstallation::query();
ParsePush::send(
$response = ParsePush::send(
[
'data' => ['alert' => 'Done without conditions!'],
'where' => $query,
],
true
);
$this->assertEquals($response['result'], 1);
}

public function testNonQueryWhere()
Expand All @@ -127,7 +130,7 @@ public function testNonQueryWhere()

public function testPushDates()
{
ParsePush::send(
$response = ParsePush::send(
[
'data' => ['alert' => 'iPhone 5 is out!'],
'push_time' => new \DateTime(),
Expand All @@ -136,6 +139,7 @@ public function testPushDates()
],
true
);
$this->assertEquals($response['result'], 1);
}

public function testExpirationTimeAndIntervalSet()
Expand Down
1 change: 1 addition & 0 deletions tests/Parse/ParseRelationOperationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,5 +172,6 @@ public function testRemoveMissingObjectId()
$obj = new ParseObject('Class1');
$op = new ParseRelationOperation(null, $obj);
$op->_mergeWithPrevious(new ParseRelationOperation(null, $obj));
$this->assertTrue(true);
}
}
3 changes: 3 additions & 0 deletions tests/Parse/ParseRelationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,5 +217,8 @@ public function testBiDirectionalRelations()

$child2->save();
$parent->save();
$this->assertEquals($parent->get('children'), [$child, $child2]);
$this->assertEquals($child->get('parent'), $parent);
$this->assertEquals($child2->get('parent'), $parent);
}
}
7 changes: 4 additions & 3 deletions tests/Parse/ParseRoleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ public function testRoleHierarchyAndPropagation()

// verify the snake can still enter the garden
ParseUser::logIn('snake', 'snake');
$query->get($eden['garden']->getObjectId());

$garden = $query->get($eden['garden']->getObjectId());
$this->assertEquals($garden->getObjectId(), $eden['garden']->getObjectId());
ParseUser::logOut();
}

Expand All @@ -184,7 +184,8 @@ public function testAddUserAfterFetch()
$roleAgain = $query->get($role->getObjectId());
$roleAgain->getUsers()->add($user);
$roleAgain->save();

$users = $roleAgain->getUsers()->getQuery()->find();
$this->assertEquals($user->getObjectId(), $users[0]->getObjectId());
ParseUser::logOut();
}

Expand Down
1 change: 1 addition & 0 deletions tests/Parse/ParseSchemaTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ public function testPurgingNonexistentSchema()
// exception on earlier versions > 2.8, no exception on >= 2.8
// thus hard to test for this unless version detection is utilized here
}
$this->assertTrue(true);
}

public function testDeleteSchema()
Expand Down
1 change: 1 addition & 0 deletions tests/Parse/ParseSessionStorageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ public function testSave()
{
// does nothing
self::$parseStorage->save();
$this->assertTrue(true);
}

/**
Expand Down
2 changes: 2 additions & 0 deletions tests/Parse/ParseUserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,7 @@ public function testPasswordReset()
$user->signUp();

ParseUser::requestPasswordReset('asdf@example.com');
$this->assertTrue(true);
}

public function testUserAssociations()
Expand Down Expand Up @@ -712,6 +713,7 @@ public function testRequestVerificationEmail()
$user->setEmail($email);
$user->signUp();
ParseUser::requestVerificationEmail($email);
$this->assertTrue(true);
}

/**
Expand Down