|
@@ 23-31 (lines=9) @@
|
| 20 |
|
class CommandTest extends TestCase |
| 21 |
|
{ |
| 22 |
|
|
| 23 |
|
public function testImport() |
| 24 |
|
{ |
| 25 |
|
Model::deleteAllFromSearch(); |
| 26 |
|
/** @var \vxm\searchable\CommandController $controller */ |
| 27 |
|
list($controller) = Yii::$app->createController('searchable'); |
| 28 |
|
$controller->models = Model::class; |
| 29 |
|
$controller->runAction('import'); |
| 30 |
|
$this->assertTrue(file_exists(Model::getSearchable()->storagePath . '/articles.index')); |
| 31 |
|
} |
| 32 |
|
|
| 33 |
|
public function testDeleteAll() |
| 34 |
|
{ |
|
@@ 33-41 (lines=9) @@
|
| 30 |
|
$this->assertTrue(file_exists(Model::getSearchable()->storagePath . '/articles.index')); |
| 31 |
|
} |
| 32 |
|
|
| 33 |
|
public function testDeleteAll() |
| 34 |
|
{ |
| 35 |
|
Model::makeAllSearchable(); |
| 36 |
|
/** @var \vxm\searchable\CommandController $controller */ |
| 37 |
|
list($controller) = Yii::$app->createController('searchable'); |
| 38 |
|
$controller->models = Model::class; |
| 39 |
|
$controller->runAction('delete'); |
| 40 |
|
$this->assertFalse(file_exists(Model::getSearchable()->storagePath . '/articles.index')); |
| 41 |
|
} |
| 42 |
|
|
| 43 |
|
} |
| 44 |
|
|