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

Fix data provider prefix #2078

Closed
wants to merge 1 commit into from
Closed
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
4 changes: 2 additions & 2 deletions tests/DemosHttpTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ protected function getPathWithAppVars(string $path): string
}

/**
* @dataProvider demoLateOutputErrorProvider
* @dataProvider provideDemoLateOutputErrorCases
*/
public function testDemoLateOutputError(string $urlTrigger, string $expectedOutput): void
{
Expand All @@ -128,7 +128,7 @@ public function testDemoLateOutputError(string $urlTrigger, string $expectedOutp
self::assertSame($expectedOutput, $response->getBody()->getContents());
}

public function demoLateOutputErrorProvider(): array
public function provideDemoLateOutputErrorCases(): array
{
$hOutput = "\n" . '!! FATAL UI ERROR: Headers already sent, more headers cannot be set at this stage !!' . "\n";
$oOutput = 'unmanaged output' . "\n" . '!! FATAL UI ERROR: Unexpected output detected !!' . "\n";
Expand Down
24 changes: 12 additions & 12 deletions tests/DemosTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ protected function getPathWithAppVars(string $path): string
/** @var string */
protected $regexSse = '~^(id|event|data).*$~m';

public function demoFilesProvider(): array
public function provideDemosStatusAndHtmlResponseCases(): array
{
$excludeDirs = ['_demo-data', '_includes'];
$excludeFiles = ['_unit-test/stream.php', 'layout/layouts_error.php'];
Expand Down Expand Up @@ -301,7 +301,7 @@ public function demoFilesProvider(): array
}

/**
* @dataProvider demoFilesProvider
* @dataProvider provideDemosStatusAndHtmlResponseCases
*/
public function testDemosStatusAndHtmlResponse(string $path): void
{
Expand All @@ -323,7 +323,7 @@ public function testDemoResponseError(): void
self::assertStringContainsString('Property for specified object is not defined', $response->getBody()->getContents());
}

public function casesDemoGetProvider(): array
public function provideDemoGetCases(): array
{
$files = [];
$files[] = ['others/sticky.php?xx=YEY'];
Expand All @@ -334,7 +334,7 @@ public function casesDemoGetProvider(): array
}

/**
* @dataProvider casesDemoGetProvider
* @dataProvider provideDemoGetCases
*/
public function testDemoGet(string $path): void
{
Expand Down Expand Up @@ -399,7 +399,7 @@ public function testWizard(): void
/**
* Test reload and loader callback.
*/
public function jsonResponseProvider(): array
public function provideDemoAssertJsonResponseCases(): array
{
$files = [];
// simple reload
Expand All @@ -414,7 +414,7 @@ public function jsonResponseProvider(): array
}

/**
* @dataProvider jsonResponseProvider
* @dataProvider provideDemoAssertJsonResponseCases
*/
public function testDemoAssertJsonResponse(string $path, string $expectedExceptionMessage = null): void
{
Expand Down Expand Up @@ -444,7 +444,7 @@ public function testDemoAssertJsonResponse(string $path, string $expectedExcepti
/**
* Test JsSse and Console.
*/
public function sseResponseProvider(): array
public function provideDemoAssertSseResponseCases(): array
{
$files = [];
$files[] = ['_unit-test/sse.php?' . Callback::URL_QUERY_TRIGGER_PREFIX . 'see_test=ajax&' . Callback::URL_QUERY_TARGET . '=1&__atk_sse=1'];
Expand All @@ -456,7 +456,7 @@ public function sseResponseProvider(): array
}

/**
* @dataProvider sseResponseProvider
* @dataProvider provideDemoAssertSseResponseCases
*/
public function testDemoAssertSseResponse(string $path): void
{
Expand Down Expand Up @@ -484,7 +484,7 @@ public function testDemoAssertSseResponse(string $path): void
}
}

public function jsonResponsePostProvider(): array
public function provideDemoAssertJsonResponsePostCases(): array
{
$files = [];
$files[] = [
Expand All @@ -498,7 +498,7 @@ public function jsonResponsePostProvider(): array
}

/**
* @dataProvider jsonResponsePostProvider
* @dataProvider provideDemoAssertJsonResponsePostCases
*/
public function testDemoAssertJsonResponsePost(string $path, array $postData): void
{
Expand All @@ -508,7 +508,7 @@ public function testDemoAssertJsonResponsePost(string $path, array $postData): v
}

/**
* @dataProvider demoCallbackErrorProvider
* @dataProvider provideDemoCallbackErrorCases
*/
public function testDemoCallbackError(string $path, string $expectedExceptionMessage): void
{
Expand All @@ -524,7 +524,7 @@ public function testDemoCallbackError(string $path, string $expectedExceptionMes
self::assertStringContainsString($expectedExceptionMessage, $responseBodyStr);
}

public function demoCallbackErrorProvider(): array
public function provideDemoCallbackErrorCases(): array
{
return [
[
Expand Down
4 changes: 2 additions & 2 deletions tests/PaginatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class PaginatorTest extends TestCase
{
public function addDataProvider(): array
public function providePaginatorCases(): array
{
return [
[1, 1, 1, [1]],
Expand All @@ -34,7 +34,7 @@ public function addDataProvider(): array
}

/**
* @dataProvider addDataProvider
* @dataProvider providePaginatorCases
*/
public function testPaginator(int $page, int $range, int $total, array $expected): void
{
Expand Down
8 changes: 4 additions & 4 deletions tests/ViewTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public function testSetException(): void
/**
* @param class-string<View|Callback> $class
*
* @dataProvider setNotClosureProvider
* @dataProvider provideSetNotClosureErrorCases
*/
public function testSetNotClosureError(string $class): void
{
Expand All @@ -168,7 +168,7 @@ public function testSetNotClosureError(string $class): void
/**
* @return list<list<class-string<View|Callback>>>
*/
public function setNotClosureProvider(): array
public function provideSetNotClosureErrorCases(): array
{
return [
[Console::class],
Expand All @@ -186,7 +186,7 @@ public function setNotClosureProvider(): array
*
* @param class-string<View> $class
*
* @dataProvider setNotOneArgumentExceptionProvider
* @dataProvider provideSetNotOneArgumentExceptionCases
*/
public function testSetNotOneArgumentException(string $class): void
{
Expand All @@ -200,7 +200,7 @@ public function testSetNotOneArgumentException(string $class): void
/**
* @return list<list<class-string<View>>>
*/
public function setNotOneArgumentExceptionProvider(): array
public function provideSetNotOneArgumentExceptionCases(): array
{
return [
[View::class],
Expand Down