2018-11-14 13:08:15 +00:00
|
|
|
<?php
|
2018-11-24 03:25:56 +00:00
|
|
|
namespace ActivityPub\Test;
|
2018-11-19 12:14:58 +00:00
|
|
|
|
2018-11-20 11:29:09 +00:00
|
|
|
use ActivityPub\ActivityPub;
|
2019-01-23 23:34:25 +00:00
|
|
|
use ActivityPub\Config\ActivityPubConfig;
|
2019-01-20 03:37:07 +00:00
|
|
|
use ActivityPub\Test\TestConfig\SQLiteTestCase;
|
|
|
|
use ActivityPub\Test\TestConfig\ArrayDataSet;
|
2018-11-14 13:08:15 +00:00
|
|
|
|
2018-11-23 13:28:46 +00:00
|
|
|
class ActivityPubTest extends SQLiteTestCase
|
2018-11-19 12:14:58 +00:00
|
|
|
{
|
|
|
|
public function getDataSet() {
|
|
|
|
return new ArrayDataSet( array() );
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testItCreatesSchema() {
|
2018-11-20 11:29:09 +00:00
|
|
|
$this->assertTrue( file_exists( $this->getDbPath() ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @depends testItCreatesSchema
|
|
|
|
*/
|
|
|
|
public function testItUpdatesSchema() {
|
2019-01-23 23:34:25 +00:00
|
|
|
$config = ActivityPubConfig::createBuilder()
|
|
|
|
->setDbConnectionParams( array(
|
|
|
|
'driver' => 'pdo_sqlite',
|
|
|
|
'path' => $this->getDbPath(),
|
|
|
|
) )
|
|
|
|
->build();
|
|
|
|
$activityPub = new ActivityPub( $config );
|
2018-11-20 11:29:09 +00:00
|
|
|
$activityPub->updateSchema();
|
|
|
|
$this->assertTrue( file_exists( $this->getDbPath() ) );
|
|
|
|
}
|
|
|
|
|
2019-01-08 15:14:42 +00:00
|
|
|
protected function getDbPath() {
|
2018-11-20 11:29:09 +00:00
|
|
|
return dirname( __FILE__ ) . '/db.sqlite';
|
2018-11-14 13:08:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|