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

0.10.x test fetch #1854

Closed
wants to merge 5 commits 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 11 additions & 0 deletions test/fetchtest.zep
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ namespace Test;

class FetchTest
{
protected _params = [];

protected values { set, get };

Expand Down Expand Up @@ -54,6 +55,16 @@ class FetchTest
return fetch a, a->{b};
}

public function testFetchArray7(var forward)
{
var params;
if fetch params, forward["params"] {
let this->_params = params;
}

return this->_params;
}

public function testFetchPost(var b)
{
var c;
Expand Down
6 changes: 6 additions & 0 deletions unit-tests/Extension/FetchTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,10 @@ public static function tearDownAfterClass()
{
self::$test = null;
}

public function testFetch7()
{
$this->assertSame(self::$test->testFetchArray7(['asd' => '123', 'params' => []]), []);
$this->assertSame(self::$test->testFetchArray7(['asd' => '123', 'params' => [],]), []);
}
}