<commit_before><?php
/**
 * ownCloud - ownbackup
 *
 * This file is licensed under the Affero General Public License version 3 or
 * later. See the COPYING file.
 *
 * @author <NAME> <<EMAIL>>
 * @copyright <NAME> 2015
 */

use OCA\OwnBackup\AppInfo\Application;
use Test\TestCase;


/**
 * This test shows how to make a small Integration Test. Query your class
 * directly from the container, only pass in mocks if needed and run your tests
 * against the database
 */
class AppTest extends TestCase {

    private $container;

    public function setUp() {
        parent::setUp();
        $app = new Application();
        $this->container = $app->getContainer();
        $app->registerSettings();
    }

    public function testAppInstalled() {
        $appManager = $this->container->query('OCP\App\IAppManager');
        $this->assertTrue($appManager->isInstalled('ownbackup'));
    }

}<commit_msg>added tests for the OwnBackup admin section<commit_after><?php
/**
 * ownCloud - ownbackup
 *
 * This file is licensed under the Affero General Public License version 3 or
 * later. See the COPYING file.
 *
 * @author <NAME> <<EMAIL>>
 * @copyright <NAME> 2015
 */

use OCA\OwnBackup\AppInfo\Application;
use Test\TestCase;


/**
 * This test shows how to make a small Integration Test. Query your class
 * directly from the container, only pass in mocks if needed and run your tests
 * against the database
 */
class AppTest extends TestCase {

    private $container;

    public function setUp() {
        parent::setUp();
        $app = new Application();
        $this->container = $app->getContainer();
        $app->registerSettings();
    }

    public function testAppInstalled() {
        $appManager = $this->container->query('OCP\App\IAppManager');
        $this->assertTrue($appManager->isInstalled('ownbackup'));
    }

    /**
     * Tests the OwnBackup admin section
     */
    public function testAdminSection() {
        $resultHtml = include "admin.php";
        $this->assertContains( '<div id="ownbackup">', $resultHtml );
        $this->assertContains( '<div class="section">', $resultHtml );
    }
}
{'fraction_non_alphanumeric': 0.12593984962406016, 'fraction_numerical': 0.004699248120300752, 'mean_word_length': 3.1500974658869394, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4014425', 'n_tokens_mistral': 604, 'n_tokens_neox': 589, 'n_words': 191}