Skip to content

Commit

Permalink
单元测试修正
Browse files Browse the repository at this point in the history
  • Loading branch information
kiss291323003 committed Jun 15, 2021
1 parent 09b7a0a commit 4547f4e
Show file tree
Hide file tree
Showing 25 changed files with 1,202 additions and 638 deletions.
1,790 changes: 1,198 additions & 592 deletions composer.lock

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion tests/Cat/MasterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ public function test()
$bean->setFormat(true);
$bean->setLocal(true);
$response = $this->getElasticSearch()->client()->cat()->master($bean)->getBody();
//var_dump($response);
$this->assertIsString($response);
}
}
1 change: 0 additions & 1 deletion tests/Cat/NodeAttrsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ public function test()
$bean->setFormat(true);
$bean->setLocal(true);
$response = $this->getElasticSearch()->client()->cat()->nodeattrs($bean)->getBody();
//var_dump($response);
$this->assertIsString($response);
}
}
2 changes: 1 addition & 1 deletion tests/Cat/PendingTasksTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function test()
// $bean->setFormat(true);
$bean->setHelp(true);
$response = $this->getElasticSearch()->client()->cat()->pendingTasks($bean)->getBody();
//var_dump($response);

$this->assertIsString($response);
}
}
1 change: 0 additions & 1 deletion tests/Cat/PluginsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ public function test()
// $bean->setFormat(true);
$bean->setHelp(true);
$response = $this->getElasticSearch()->client()->cat()->plugins($bean)->getBody();
// var_dump($response);
$this->assertIsString($response);
}
}
2 changes: 1 addition & 1 deletion tests/Cat/RecoveryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function test()
$bean->setIndex('my-index');
$bean->setFormat(true);
$response = $this->getElasticSearch()->client()->cat()->recovery($bean)->getBody();
//var_dump($response);

$this->assertIsString($response);
}
}
1 change: 0 additions & 1 deletion tests/Cat/RepositoriesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ public function test()
// $bean->setFormat(true);
$bean->setHelp(true);
$response = $this->getElasticSearch()->client()->cat()->repositories($bean)->getBody();
//var_dump($response);
$this->assertIsString($response);
}
}
2 changes: 1 addition & 1 deletion tests/Cat/SegmentsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function test()
$bean->setFormat(true);
//$bean->setHelp(true);
$response = $this->getElasticSearch()->client()->cat()->segments($bean)->getBody();
//var_dump($response);

$this->assertIsString($response);
}
}
1 change: 0 additions & 1 deletion tests/Cat/ShardsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ public function test()
$bean = new Shards();
$bean->setIndex('my-index');
$response = $this->getElasticSearch()->client()->cat()->shards($bean)->getBody();
//var_dump($response);
$this->assertIsString($response);
}
}
2 changes: 1 addition & 1 deletion tests/Cat/SnapshotsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function test(){

$bean->setHelp(true);
$response = $this->getElasticSearch()->client()->cat()->snapshots($bean)->getBody();
//var_dump($response);

$this->assertIsString($response);
}
}
1 change: 0 additions & 1 deletion tests/Cat/TasksTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ public function test(){
$bean = new Tasks();
$bean->setHelp(true);
$response = $this->getElasticSearch()->client()->cat()->tasks($bean)->getBody();
//var_dump($response);
$this->assertIsString($response);
}
}
1 change: 0 additions & 1 deletion tests/Cat/TemplatesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ public function test()
$bean = new Templates();
$bean->setHelp(true);
$response = $this->getElasticSearch()->client()->cat()->templates($bean)->getBody();
//var_dump($response);
$this->assertIsString($response);
}
}
1 change: 0 additions & 1 deletion tests/Cat/ThreadPoolTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ public function test()
$bean = new ThreadPool();
$bean->setHelp(true);
$response = $this->getElasticSearch()->client()->cat()->threadPool($bean)->getBody();
//var_dump($response);
$this->assertIsString($response);
}
}
1 change: 0 additions & 1 deletion tests/CountTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ public function test()
$bean = new \EasySwoole\ElasticSearch\RequestBean\Count();
$response = $this->getElasticSearch()->client()->count($bean)->getBody();
$response = json_decode($response, true);
print_r($response);
$this->assertArrayHasKey('count', $response);
}
}
1 change: 0 additions & 1 deletion tests/CreateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ function test()
$bean->setBody(['test-field' => 'abd']);
$response = $this->getElasticSearch()->client()->create($bean)->getBody();
$response = json_decode($response, true);
var_dump('------------create', $response);
$this->assertEquals('created', $response['result']);
}
}
1 change: 0 additions & 1 deletion tests/GetSourceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ public function test()
$bean->setId('my-id');
$response = $this->getElasticSearch()->client()->getSource($bean)->getBody();
$response = json_decode($response, true);
var_dump('--------get source', $response);
$this->assertEquals('abd', $response['test-field']);
}
}
1 change: 0 additions & 1 deletion tests/IndexTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ public function test()
$bean->setBody(['test-field' => '测试' . $time]);
$response = $this->getElasticSearch()->client()->index($bean)->getBody();
$response = json_decode($response, true);
var_dump('--------index', $response);
$this->assertEquals('created', $response['result']);
}
}
1 change: 0 additions & 1 deletion tests/Indices/PutSettingsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ public function test()
]);
$response = $this->getElasticSearch()->client()->indices()->putSettings($bean)->getBody();
$response = json_decode($response, true);
var_dump('----------put settings', $response);
$this->assertArrayNotHasKey('error', $response);
}
}
3 changes: 0 additions & 3 deletions tests/Indices/ShrinkTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ public function test()
"index.blocks.write" => true
]]);
$response = $this->getElasticSearch()->client()->indices()->create($bean)->getBody();
var_dump($response);
$this->assertArrayNotHasKey('error', json_decode($response, true));

$bean = new Shrink();
Expand All @@ -48,8 +47,6 @@ public function test()
]);
$response = $this->getElasticSearch()->client()->indices()->shrink($bean)->getBody();
$response = json_decode($response, true);
var_dump('------------------shrink test');
var_dump($response);
$this->assertArrayNotHasKey('error', $response);
}
}
3 changes: 0 additions & 3 deletions tests/Indices/SplitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ public function test()
"index.blocks.write" => true
]]);
$response = $this->getElasticSearch()->client()->indices()->create($bean)->getBody();
var_dump($response);
$this->assertArrayNotHasKey('error', json_decode($response, true));

$bean = new Split();
Expand All @@ -49,8 +48,6 @@ public function test()

$response = $this->getElasticSearch()->client()->indices()->split($bean)->getBody();
$response = json_decode($response, true);
var_dump('--------------split');
var_dump($response);
$this->assertArrayNotHasKey('error', $response);
}
}
1 change: 0 additions & 1 deletion tests/Indices/UpdateAliasesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ public function test()
);
$response = $this->getElasticSearch()->client()->indices()->updateAliases($bean)->getBody();
$response = json_decode($response, true);
var_dump('-----------update alias', $response);
$this->assertArrayNotHasKey('error', $response);
}
}
1 change: 0 additions & 1 deletion tests/Indices/ValidateQueryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ public function test()
);
$response = $this->getElasticSearch()->client()->indices()->validateQuery($bean)->getBody();
$response = json_decode($response, true);
print_r($response);
$this->assertArrayNotHasKey('error', $response);
}
}
2 changes: 0 additions & 2 deletions tests/Ingest/SimulateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ public function test()
]);
$response = $this->getElasticSearch()->client()->ingest()->simulate($bean)->getBody();
$response = json_decode($response, true);
var_dump('-----------simulate');
var_dump($response);
$this->assertArrayNotHasKey('error', $response);
}
}
1 change: 0 additions & 1 deletion tests/UpdateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ public function test()
]);
$response = $this->getElasticSearch()->client()->update($bean)->getBody();
$response = json_decode($response, true);
var_dump('--------update', $response);
$this->assertIsArray($response);
$this->assertArrayHasKey('_shards', $response);
}
Expand Down
18 changes: 0 additions & 18 deletions tests/test.php

This file was deleted.

0 comments on commit 4547f4e

Please sign in to comment.