fix: data callback

This commit is contained in:
Jaeger
2020-04-01 22:03:50 +08:00
parent c16826a573
commit faea883c6f
7 changed files with 58 additions and 45 deletions

View File

@@ -18,7 +18,7 @@ class HttpTest extends TestCaseBase
{
protected $urls;
public function setUp()
protected function setUp(): void
{
$this->urls = [
'http://httpbin.org/get?name=php',

View File

@@ -16,7 +16,7 @@ class InstanceTest extends TestCaseBase
{
protected $html;
public function setUp()
protected function setUp(): void
{
$this->html = $this->getSnippet('snippet-1');
}
@@ -38,11 +38,11 @@ class InstanceTest extends TestCaseBase
public function get_new_object()
{
$ql = (new QueryList())->html($this->html);
$ql2 = new QueryList();
$ql2 = (new QueryList())->html('');
$this->assertNotEquals($ql->getHtml(),$ql2->getHtml());
$ql = QueryList::range('')->html($this->html);
$ql2 = QueryList::range('');
$ql2 = QueryList::range('')->html('');
$this->assertNotEquals($ql->getHtml(),$ql2->getHtml());
}
}

View File

@@ -16,7 +16,7 @@ class MethodTest extends TestCaseBase
{
protected $html;
public function setUp()
protected function setUp(): void
{
$this->html = $this->getSnippet('snippet-1');
}
@@ -30,7 +30,7 @@ class MethodTest extends TestCaseBase
$qlHtml = QueryList::pipe(function(QueryList $ql) use($html){
$ql->setHtml($html);
return $ql;
})->getHtml();
})->getHtml(false);
$this->assertEquals($html,$qlHtml);
}
}