Revision ed912c77
Added by Assos Assos about 6 years ago
drupal7/sites/all/modules/libraries/tests/LibrariesAdminWebTest.test | ||
---|---|---|
40 | 40 |
* Tests the libraries report at /admin/reports/libraries. |
41 | 41 |
*/ |
42 | 42 |
public function testLibrariesReportOverview() { |
43 |
$this->getWithPermissions(array('access site reports'), 'admin/reports/libraries'); |
|
44 |
$this->assertRaw('Libraries'); |
|
43 |
$this->getWithPermissions(array('access library reports'), 'admin/reports/libraries'); |
|
44 |
// Assert the page title and table titles show up. |
|
45 |
$this->assertText('Libraries'); |
|
46 |
$this->assertRaw('<h2>Installed</h2>'); |
|
47 |
$this->assertRaw('<h2>Uninstalled</h2>'); |
|
48 |
|
|
49 |
// Make sure the table headings show up. |
|
50 |
$this->assertText('Name'); |
|
51 |
$this->assertText('Status'); |
|
52 |
$this->assertText('Version'); |
|
53 |
$this->assertText('Variants'); |
|
54 |
$this->assertText('Dependencies'); |
|
55 |
$this->assertText('Provider'); |
|
56 |
$this->assertText('Links'); |
|
45 | 57 |
|
46 | 58 |
// Make sure that all the libraries are listed. |
47 | 59 |
$libraries = libraries_info(); |
... | ... | |
51 | 63 |
$this->assertLinkByHref('admin/reports/libraries/' . $library['machine name']); |
52 | 64 |
} |
53 | 65 |
|
54 |
// Make sure that all possible statuses are displayed. |
|
55 |
$this->assertText('OK'); |
|
66 |
// Make sure that all possible error statuses are displayed. |
|
56 | 67 |
$this->assertText('Not found'); |
57 | 68 |
$this->assertText('Not detected'); |
58 | 69 |
$this->assertText('Not supported'); |
... | ... | |
73 | 84 |
* Tests the libraries report for an installed library. |
74 | 85 |
*/ |
75 | 86 |
public function testLibrariesReportInstalled() { |
76 |
$this->getWithPermissions(array('access site reports'), 'admin/reports/libraries/example_files');
|
|
87 |
$this->getWithPermissions(array('access library reports'), 'admin/reports/libraries/example_files');
|
|
77 | 88 |
$this->assertRaw('Status report for library <em class="placeholder">Example files</em>'); |
78 | 89 |
$this->assertRaw('The <em class="placeholder">Example files</em> library is installed correctly.'); |
79 | 90 |
// Check that the information in the status report is displayed. |
... | ... | |
88 | 99 |
* Tests the libraries report for a missing library. |
89 | 100 |
*/ |
90 | 101 |
public function testLibrariesReportMissing() { |
91 |
$this->getWithPermissions(array('access site reports'), 'admin/reports/libraries/example_missing');
|
|
102 |
$this->getWithPermissions(array('access library reports'), 'admin/reports/libraries/example_missing');
|
|
92 | 103 |
$this->assertRaw('Status report for library <em class="placeholder">Example missing</em>'); |
93 | 104 |
$this->assertRaw('The <em class="placeholder">Example missing</em> library could not be found.'); |
94 | 105 |
// Check that the download link is being displayed. |
... | ... | |
100 | 111 |
* Tests the libraries report for a missing library. |
101 | 112 |
*/ |
102 | 113 |
public function testLibrariesReportNotDetected() { |
103 |
$this->getWithPermissions(array('access site reports'), 'admin/reports/libraries/example_undetected_version');
|
|
114 |
$this->getWithPermissions(array('access library reports'), 'admin/reports/libraries/example_undetected_version');
|
|
104 | 115 |
$this->assertRaw('Status report for library <em class="placeholder">Example undetected version</em>'); |
105 | 116 |
$this->assertRaw('The version of the <em class="placeholder">Example undetected version</em> library could not be detected.'); |
106 | 117 |
} |
... | ... | |
109 | 120 |
* Tests the libraries report for a missing library. |
110 | 121 |
*/ |
111 | 122 |
public function testLibrariesReportNotSupported() { |
112 |
$this->getWithPermissions(array('access site reports'), 'admin/reports/libraries/example_unsupported_version');
|
|
123 |
$this->getWithPermissions(array('access library reports'), 'admin/reports/libraries/example_unsupported_version');
|
|
113 | 124 |
$this->assertRaw('Status report for library <em class="placeholder">Example unsupported version</em>'); |
114 | 125 |
$this->assertRaw('The installed version <em class="placeholder">1</em> of the <em class="placeholder">Example unsupported version</em> library is not supported.'); |
115 | 126 |
// Check that the download link is being displayed. |
Also available in: Unified diff
Weekly update of contrib modules