Artesaos\Defender\Testing\DefenderServiceProviderTest::testShouldPublishConfigAndMigrations PHP Method

testShouldPublishConfigAndMigrations() public method

Publishes the configuration and migrations.
    public function testShouldPublishConfigAndMigrations()
    {
        $this->artisan('vendor:publish');
        $resourcesPath = __DIR__ . '/../../src/resources';
        $migrations = [$resourcesPath . '/migrations/2015_02_23_161101_create_defender_roles_table.php', $resourcesPath . '/migrations/2015_02_23_161102_create_defender_permissions_table.php', $resourcesPath . '/migrations/2015_02_23_161103_create_defender_role_user_table.php', $resourcesPath . '/migrations/2015_02_23_161104_create_defender_permission_user_table.php', $resourcesPath . '/migrations/2015_02_23_161105_create_defender_permission_role_table.php'];
        /*
         * Being sure the number of migrations described is the total expected.
         */
        $this->assertEquals(count(glob($resourcesPath . '/migrations/*.php')), count(array_unique($migrations)));
        $config = $resourcesPath . '/config/defender.php';
        foreach ($migrations as $migration) {
            $this->assertFileExists($migration);
            $this->assertFileExists(base_path('database/migrations/' . basename($migration)));
        }
        $this->assertFileExists(config_path(basename($config)));
    }