Skip to content
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

Remove a couple of non-test tests - syntax conformance #23715

Merged
merged 1 commit into from
Jun 8, 2022
Merged
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
34 changes: 0 additions & 34 deletions tests/phpunit/api/v3/SyntaxConformanceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1261,22 +1261,6 @@ public function testNotImplemented_create($Entity) {
$this->assertStringContainsString(strtolower("API ($Entity, Create) does not exist"), strtolower($result['error_message']));
}

/**
* @dataProvider entities
* @param $Entity
*/
public function testWithoutParam_create($Entity) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eileenmcnaughton I guess this is just testing that an APIv3 Exception or similar is thrown if no params are passed in right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah - I think it would be a mandatory field validation error - perhaps it is of some value - but it just feels like we have too many of these tests now

$this->expectException(CiviCRM_API3_Exception::class);
if ($Entity === 'Setting') {
$this->markTestSkipped('It seems OK for setting to skip here as it silently sips invalid params');
}
elseif ($Entity === 'Mailing') {
$this->markTestSkipped('It seems OK for "Mailing" to skip here because you can create empty drafts');
}
// should create php complaining that a param is missing
civicrm_api3($Entity, 'Create');
}

/**
* @dataProvider entities_create
*
Expand Down Expand Up @@ -1319,24 +1303,6 @@ public function testValidSortSingleArrayById_get($Entity) {
}
}

/**
* @dataProvider entities_create
*
* Check that create doesn't work with an invalid
* @param $Entity
* @throws \PHPUnit\Framework\IncompleteTestError
*/
public function testInvalidID_create($Entity) {
// turn test off for noew
$this->markTestIncomplete("Entity [ $Entity ] cannot be mocked - no known DAO");
return;
if (in_array($Entity, $this->toBeImplemented['create'])) {
// $this->markTestIncomplete("civicrm_api3_{$Entity}_create to be implemented");
return;
}
$result = $this->callAPIFailure($Entity, 'Create', ['id' => 999]);
}

/**
* @dataProvider entities_updatesingle
*
Expand Down