123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
- <?php
- class LibrariesAdminWebTest extends LibrariesWebTestBase {
-
- public static function getInfo() {
- return array(
- 'name' => 'Libraries administration',
- 'description' => 'Tests the administrative interface for libraries.',
- 'group' => 'Libraries API',
- );
- }
-
- public function testLibrariesReportOverview() {
- $this->getWithPermissions(array('access site reports'), 'admin/reports/libraries');
- $this->assertRaw('Libraries');
-
- $libraries = libraries_info();
- $this->assertTrue($libraries);
- foreach ($libraries as $library) {
- $this->assertText($library['name']);
- $this->assertLinkByHref('admin/reports/libraries/' . $library['machine name']);
- }
-
- $this->assertText('OK');
- $this->assertText('Not found');
- $this->assertText('Not detected');
- $this->assertText('Not supported');
- $this->assertText('Missing dependency');
- $this->assertText('Incompatible dependency');
-
- $this->assertRaw('<em class="placeholder">Libraries test module</em> module');
- $this->assertRaw('<em class="placeholder">Libraries test theme</em> theme');
- $this->assertRaw('<em class="placeholder">example_info_file.libraries.info</em> info file');
-
- $this->assertLinkByHref('http://example.com');
- $this->assertLinkByHref('http://example.com/download');
- }
-
- public function testLibrariesReportInstalled() {
- $this->getWithPermissions(array('access site reports'), 'admin/reports/libraries/example_files');
- $this->assertRaw('Status report for library <em class="placeholder">Example files</em>');
- $this->assertRaw('The <em class="placeholder">Example files</em> library is installed correctly.');
-
- $this->assertText('Example files');
- $this->assertText('example_files');
- $this->assertRaw('<em class="placeholder">Libraries test module</em> module');
- $this->assertText(drupal_get_path('module', 'libraries') . '/tests/libraries/example');
- $this->assertText('1');
- }
-
- public function testLibrariesReportMissing() {
- $this->getWithPermissions(array('access site reports'), 'admin/reports/libraries/example_missing');
- $this->assertRaw('Status report for library <em class="placeholder">Example missing</em>');
- $this->assertRaw('The <em class="placeholder">Example missing</em> library could not be found.');
-
- $this->assertLinkByHref('http://example.com/download');
- }
-
- public function testLibrariesReportNotDetected() {
- $this->getWithPermissions(array('access site reports'), 'admin/reports/libraries/example_undetected_version');
- $this->assertRaw('Status report for library <em class="placeholder">Example undetected version</em>');
- $this->assertRaw('The version of the <em class="placeholder">Example undetected version</em> library could not be detected.');
- }
-
- public function testLibrariesReportNotSupported() {
- $this->getWithPermissions(array('access site reports'), 'admin/reports/libraries/example_unsupported_version');
- $this->assertRaw('Status report for library <em class="placeholder">Example unsupported version</em>');
- $this->assertRaw('The installed version <em class="placeholder">1</em> of the <em class="placeholder">Example unsupported version</em> library is not supported.');
-
- $this->assertLinkByHref('http://example.com/download');
- }
- }
|