go1 / util_dataset
This package's canonical repository appears to be gone and the package has been frozen as a result.
Installs: 7 388
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 15
Forks: 3
Open Issues: 0
Requires
- php: ^7.1
- go1/util: dev-master
- go1/util_core: dev-master
- go1/util_es: dev-master
This package is auto-updated.
Last update: 2024-05-14 01:30:30 UTC
README
Easier for developer to setup data-set for test cases.
Dump data
php $MONOLITH/scripts/dummy/dataset.php main --user=$USER_NAME $PORTAL_ID
Import data
<?php class MyTest extends \PHPUnit\Framework\TestCase { use \go1\util_dataset\ElasticSearchJsonImportingTrait; public function test() { /** @var \go1\app\App $app */ $app = $this->getApp(); $portalId = 500592; $jsonDirectory = 'fixtures/500592/'; $this->import($app['dbs']['go1'], $app['go1.client.es'], \go1\util\es\Schema::portalIndex($portalId), $app['accounts_name'], $jsonDirectory); } }
Data generator
<?php class MyTest extends \PHPUnit\Framework\TestCase { use \go1\util_dataset\generator\CoreDataGeneratorTrait; public function testSomeFeature() { $app = $this->getApp(); $this->generatePortalData($app['dbs']['go1'], $app['accounts_name']); } }