Skip to content
Snippets Groups Projects
Commit 28b848b7 authored by André Matheus Pedrosa's avatar André Matheus Pedrosa Committed by Joseph Olstad
Browse files

Issue #3256985 by urvashi_vora, andregp, beatrizrodrigues, Matheus Macario:...

Issue #3256985 by urvashi_vora, andregp, beatrizrodrigues, Matheus Macario: Deprecated code on LibrariesWebTest.php
parent 5bbf2e31
Branches 2.1.x
Tags 2.1.0
1 merge request!20Issue #3256949 by urvashi_vora, andregp, tmaiochi, joseph.olstad: Validate...
...@@ -69,8 +69,8 @@ class LibrariesWebTest extends BrowserTestBase { ...@@ -69,8 +69,8 @@ class LibrariesWebTest extends BrowserTestBase {
'%dependency' => 'Example missing', '%dependency' => 'Example missing',
'%library' => $library['name'], '%library' => $library['name'],
]); ]);
$this->verbose("Expected:<br>$error_message"); dump("Expected:<br>$error_message");
$this->verbose('Actual:<br>' . $library['error message']); dump('Actual:<br>' . $library['error message']);
$this->assertEquals($library['error message'], $error_message, 'Correct error message for a missing dependency'); $this->assertEquals($library['error message'], $error_message, 'Correct error message for a missing dependency');
// Test versioned dependencies. // Test versioned dependencies.
$version = '1.1'; $version = '1.1';
...@@ -127,8 +127,8 @@ class LibrariesWebTest extends BrowserTestBase { ...@@ -127,8 +127,8 @@ class LibrariesWebTest extends BrowserTestBase {
'%dependency' => 'Example dependency', '%dependency' => 'Example dependency',
'%library' => $library['name'], '%library' => $library['name'],
]); ]);
$this->verbose("Expected:<br>$error_message"); dump("Expected:<br>$error_message");
$this->verbose('Actual:<br>' . $library['error message']); dump('Actual:<br>' . $library['error message']);
$this->assertEquals($library['error message'], $error_message, 'Correct error message for an incompatible dependency'); $this->assertEquals($library['error message'], $error_message, 'Correct error message for an incompatible dependency');
} }
...@@ -144,10 +144,10 @@ class LibrariesWebTest extends BrowserTestBase { ...@@ -144,10 +144,10 @@ class LibrariesWebTest extends BrowserTestBase {
], ],
]; ];
$actual = libraries_scan_info_files(); $actual = libraries_scan_info_files();
$this->verbose('Expected:<pre>' . var_export($expected, TRUE) . '</pre>'); dump('Expected:<pre>' . var_export($expected, TRUE) . '</pre>');
$this->verbose('Actual:<pre>' . var_export($actual, TRUE) . '</pre>'); dump('Actual:<pre>' . var_export($actual, TRUE) . '</pre>');
$this->assertEquals($actual, $expected, 'libraries_scan_info_files() correctly finds the example info file.'); $this->assertEquals($actual, $expected, 'libraries_scan_info_files() correctly finds the example info file.');
$this->verbose('<pre>' . var_export(libraries_scan_info_files(), TRUE) . '</pre>'); dump('<pre>' . var_export(libraries_scan_info_files(), TRUE) . '</pre>');
} }
/** /**
...@@ -168,8 +168,8 @@ class LibrariesWebTest extends BrowserTestBase { ...@@ -168,8 +168,8 @@ class LibrariesWebTest extends BrowserTestBase {
]; ];
libraries_info_defaults($expected, 'example_files'); libraries_info_defaults($expected, 'example_files');
$library = libraries_info('example_files'); $library = libraries_info('example_files');
$this->verbose('Expected:<pre>' . var_export($expected, TRUE) . '</pre>'); dump('Expected:<pre>' . var_export($expected, TRUE) . '</pre>');
$this->verbose('Actual:<pre>' . var_export($library, TRUE) . '</pre>'); dump('Actual:<pre>' . var_export($library, TRUE) . '</pre>');
$this->assertEquals($library, $expected, 'Library information is correctly gathered.'); $this->assertEquals($library, $expected, 'Library information is correctly gathered.');
// Test a library specified with an .info file gets detected. // Test a library specified with an .info file gets detected.
...@@ -183,8 +183,8 @@ class LibrariesWebTest extends BrowserTestBase { ...@@ -183,8 +183,8 @@ class LibrariesWebTest extends BrowserTestBase {
// system has corrupted the test info file. // system has corrupted the test info file.
// @see http://drupal.org/node/1606606 // @see http://drupal.org/node/1606606
unset($library['core'], $library['datestamp'], $library['project'], $library['version']); unset($library['core'], $library['datestamp'], $library['project'], $library['version']);
$this->verbose('Expected:<pre>' . var_export($expected, TRUE) . '</pre>'); dump('Expected:<pre>' . var_export($expected, TRUE) . '</pre>');
$this->verbose('Actual:<pre>' . var_export($library, TRUE) . '</pre>'); dump('Actual:<pre>' . var_export($library, TRUE) . '</pre>');
$this->assertEquals($library, $expected, 'Library specified with an .info file found'); $this->assertEquals($library, $expected, 'Library specified with an .info file found');
} }
...@@ -194,7 +194,7 @@ class LibrariesWebTest extends BrowserTestBase { ...@@ -194,7 +194,7 @@ class LibrariesWebTest extends BrowserTestBase {
public function testLibrariesDetect() { public function testLibrariesDetect() {
// Test missing library. // Test missing library.
$library = libraries_detect('example_missing'); $library = libraries_detect('example_missing');
$this->verbose('<pre>' . var_export($library, TRUE) . '</pre>'); dump('<pre>' . var_export($library, TRUE) . '</pre>');
$this->assertEquals($library['error'], 'not found', 'Missing library not found.'); $this->assertEquals($library['error'], 'not found', 'Missing library not found.');
$error_message = t('The %library library could not be found.', [ $error_message = t('The %library library could not be found.', [
'%library' => $library['name'], '%library' => $library['name'],
...@@ -203,7 +203,7 @@ class LibrariesWebTest extends BrowserTestBase { ...@@ -203,7 +203,7 @@ class LibrariesWebTest extends BrowserTestBase {
// Test unknown library version. // Test unknown library version.
$library = libraries_detect('example_undetected_version'); $library = libraries_detect('example_undetected_version');
$this->verbose('<pre>' . var_export($library, TRUE) . '</pre>'); dump('<pre>' . var_export($library, TRUE) . '</pre>');
$this->assertEquals($library['error'], 'not detected', 'Undetected version detected as such.'); $this->assertEquals($library['error'], 'not detected', 'Undetected version detected as such.');
$error_message = t('The version of the %library library could not be detected.', [ $error_message = t('The version of the %library library could not be detected.', [
'%library' => $library['name'], '%library' => $library['name'],
...@@ -212,7 +212,7 @@ class LibrariesWebTest extends BrowserTestBase { ...@@ -212,7 +212,7 @@ class LibrariesWebTest extends BrowserTestBase {
// Test unsupported library version. // Test unsupported library version.
$library = libraries_detect('example_unsupported_version'); $library = libraries_detect('example_unsupported_version');
$this->verbose('<pre>' . var_export($library, TRUE) . '</pre>'); dump('<pre>' . var_export($library, TRUE) . '</pre>');
$this->assertEquals($library['error'], 'not supported', 'Unsupported version detected as such.'); $this->assertEquals($library['error'], 'not supported', 'Unsupported version detected as such.');
$error_message = t('The installed version %version of the %library library is not supported.', [ $error_message = t('The installed version %version of the %library library is not supported.', [
'%version' => $library['version'], '%version' => $library['version'],
...@@ -222,17 +222,17 @@ class LibrariesWebTest extends BrowserTestBase { ...@@ -222,17 +222,17 @@ class LibrariesWebTest extends BrowserTestBase {
// Test supported library version. // Test supported library version.
$library = libraries_detect('example_supported_version'); $library = libraries_detect('example_supported_version');
$this->verbose('<pre>' . var_export($library, TRUE) . '</pre>'); dump('<pre>' . var_export($library, TRUE) . '</pre>');
$this->assertEquals($library['installed'], TRUE, 'Supported library version found.'); $this->assertEquals($library['installed'], TRUE, 'Supported library version found.');
// Test libraries_get_version(). // Test libraries_get_version().
$library = libraries_detect('example_default_version_callback'); $library = libraries_detect('example_default_version_callback');
$this->verbose('<pre>' . var_export($library, TRUE) . '</pre>'); dump('<pre>' . var_export($library, TRUE) . '</pre>');
$this->assertEquals($library['version'], '1', 'Expected version returned by default version callback.'); $this->assertEquals($library['version'], '1', 'Expected version returned by default version callback.');
// Test a multiple-parameter version callback. // Test a multiple-parameter version callback.
$library = libraries_detect('example_multiple_parameter_version_callback'); $library = libraries_detect('example_multiple_parameter_version_callback');
$this->verbose('<pre>' . var_export($library, TRUE) . '</pre>'); dump('<pre>' . var_export($library, TRUE) . '</pre>');
$this->assertEquals($library['version'], '1', 'Expected version returned by multiple parameter version callback.'); $this->assertEquals($library['version'], '1', 'Expected version returned by multiple parameter version callback.');
// Test a top-level files property. // Test a top-level files property.
...@@ -242,7 +242,7 @@ class LibrariesWebTest extends BrowserTestBase { ...@@ -242,7 +242,7 @@ class LibrariesWebTest extends BrowserTestBase {
'css' => ['example_1.css' => []], 'css' => ['example_1.css' => []],
'php' => ['example_1.php' => []], 'php' => ['example_1.php' => []],
]; ];
$this->verbose('<pre>' . var_export($library, TRUE) . '</pre>'); dump('<pre>' . var_export($library, TRUE) . '</pre>');
$this->assertEquals($library['files'], $files, 'Top-level files property works.'); $this->assertEquals($library['files'], $files, 'Top-level files property works.');
// Test version-specific library files. // Test version-specific library files.
...@@ -252,12 +252,12 @@ class LibrariesWebTest extends BrowserTestBase { ...@@ -252,12 +252,12 @@ class LibrariesWebTest extends BrowserTestBase {
'css' => ['example_2.css' => []], 'css' => ['example_2.css' => []],
'php' => ['example_2.php' => []], 'php' => ['example_2.php' => []],
]; ];
$this->verbose('<pre>' . var_export($library, TRUE) . '</pre>'); dump('<pre>' . var_export($library, TRUE) . '</pre>');
$this->assertEquals($library['files'], $files, 'Version-specific library files found.'); $this->assertEquals($library['files'], $files, 'Version-specific library files found.');
// Test missing variant. // Test missing variant.
$library = libraries_detect('example_variant_missing'); $library = libraries_detect('example_variant_missing');
$this->verbose('<pre>' . var_export($library, TRUE) . '</pre>'); dump('<pre>' . var_export($library, TRUE) . '</pre>');
$this->assertEquals($library['variants']['example_variant']['error'], 'not found', 'Missing variant not found'); $this->assertEquals($library['variants']['example_variant']['error'], 'not found', 'Missing variant not found');
$error_message = t('The %variant variant of the %library library could not be found.', [ $error_message = t('The %variant variant of the %library library could not be found.', [
'%variant' => 'example_variant', '%variant' => 'example_variant',
...@@ -267,7 +267,7 @@ class LibrariesWebTest extends BrowserTestBase { ...@@ -267,7 +267,7 @@ class LibrariesWebTest extends BrowserTestBase {
// Test existing variant. // Test existing variant.
$library = libraries_detect('example_variant'); $library = libraries_detect('example_variant');
$this->verbose('<pre>' . var_export($library, TRUE) . '</pre>'); dump('<pre>' . var_export($library, TRUE) . '</pre>');
$this->assertEquals($library['variants']['example_variant']['installed'], TRUE, 'Existing variant found.'); $this->assertEquals($library['variants']['example_variant']['installed'], TRUE, 'Existing variant found.');
} }
...@@ -279,16 +279,16 @@ class LibrariesWebTest extends BrowserTestBase { ...@@ -279,16 +279,16 @@ class LibrariesWebTest extends BrowserTestBase {
public function _testLibrariesLoad() { public function _testLibrariesLoad() {
// Test dependencies. // Test dependencies.
$library = libraries_load('example_dependency_missing'); $library = libraries_load('example_dependency_missing');
$this->verbose('<pre>' . var_export($library, TRUE) . '</pre>'); dump('<pre>' . var_export($library, TRUE) . '</pre>');
$this->assertFalse($library['loaded'], 'Library with missing dependency cannot be loaded'); $this->assertFalse($library['loaded'], 'Library with missing dependency cannot be loaded');
$library = libraries_load('example_dependency_incompatible'); $library = libraries_load('example_dependency_incompatible');
$this->verbose('<pre>' . var_export($library, TRUE) . '</pre>'); dump('<pre>' . var_export($library, TRUE) . '</pre>');
$this->assertFalse($library['loaded'], 'Library with incompatible dependency cannot be loaded'); $this->assertFalse($library['loaded'], 'Library with incompatible dependency cannot be loaded');
$library = libraries_load('example_dependency_compatible'); $library = libraries_load('example_dependency_compatible');
$this->verbose('<pre>' . var_export($library, TRUE) . '</pre>'); dump('<pre>' . var_export($library, TRUE) . '</pre>');
$this->assertEquals($library['loaded'], 1, 'Library with compatible dependency is loaded'); $this->assertEquals($library['loaded'], 1, 'Library with compatible dependency is loaded');
$loaded = &drupal_static('libraries_load'); $loaded = &drupal_static('libraries_load');
$this->verbose('<pre>' . var_export($loaded, TRUE) . '</pre>'); dump('<pre>' . var_export($loaded, TRUE) . '</pre>');
$this->assertEquals($loaded['example_dependency']['loaded'], 1, 'Dependency library is also loaded'); $this->assertEquals($loaded['example_dependency']['loaded'], 1, 'Dependency library is also loaded');
} }
...@@ -349,8 +349,8 @@ class LibrariesWebTest extends BrowserTestBase { ...@@ -349,8 +349,8 @@ class LibrariesWebTest extends BrowserTestBase {
$expected['versions']['1']['variants']['example_variant']['info callback'] = 'applied (version 1, variant example_variant)'; $expected['versions']['1']['variants']['example_variant']['info callback'] = 'applied (version 1, variant example_variant)';
$expected['variants']['example_variant']['info callback'] = 'applied (variant example_variant)'; $expected['variants']['example_variant']['info callback'] = 'applied (variant example_variant)';
$library = libraries_info('example_callback'); $library = libraries_info('example_callback');
$this->verbose('Expected:<pre>' . var_export($expected, TRUE) . '</pre>'); dump('Expected:<pre>' . var_export($expected, TRUE) . '</pre>');
$this->verbose('Actual:<pre>' . var_export($library, TRUE) . '</pre>'); dump('Actual:<pre>' . var_export($library, TRUE) . '</pre>');
$this->assertEquals($library, $expected, 'Prepare callback was applied correctly.'); $this->assertEquals($library, $expected, 'Prepare callback was applied correctly.');
// Test a callback in the 'pre-detect' and 'post-detect' phases. // Test a callback in the 'pre-detect' and 'post-detect' phases.
...@@ -370,8 +370,8 @@ class LibrariesWebTest extends BrowserTestBase { ...@@ -370,8 +370,8 @@ class LibrariesWebTest extends BrowserTestBase {
$expected['variants']['example_variant']['pre-detect callback'] = 'applied (version 1, variant example_variant)'; $expected['variants']['example_variant']['pre-detect callback'] = 'applied (version 1, variant example_variant)';
$expected['variants']['example_variant']['post-detect callback'] = 'applied (variant example_variant)'; $expected['variants']['example_variant']['post-detect callback'] = 'applied (variant example_variant)';
$library = libraries_detect('example_callback'); $library = libraries_detect('example_callback');
$this->verbose('Expected:<pre>' . var_export($expected, TRUE) . '</pre>'); dump('Expected:<pre>' . var_export($expected, TRUE) . '</pre>');
$this->verbose('Actual:<pre>' . var_export($library, TRUE) . '</pre>'); dump('Actual:<pre>' . var_export($library, TRUE) . '</pre>');
$this->assertEquals($library, $expected, 'Detect callback was applied correctly.'); $this->assertEquals($library, $expected, 'Detect callback was applied correctly.');
// Test a callback in the 'pre-load' and 'post-load' phases. // Test a callback in the 'pre-load' and 'post-load' phases.
...@@ -382,8 +382,8 @@ class LibrariesWebTest extends BrowserTestBase { ...@@ -382,8 +382,8 @@ class LibrariesWebTest extends BrowserTestBase {
$expected['pre-load callback'] = 'applied (top-level)'; $expected['pre-load callback'] = 'applied (top-level)';
$expected['post-load callback'] = 'applied (top-level)'; $expected['post-load callback'] = 'applied (top-level)';
$library = libraries_load('example_callback'); $library = libraries_load('example_callback');
$this->verbose('Expected:<pre>' . var_export($expected, TRUE) . '</pre>'); dump('Expected:<pre>' . var_export($expected, TRUE) . '</pre>');
$this->verbose('Actual:<pre>' . var_export($library, TRUE) . '</pre>'); dump('Actual:<pre>' . var_export($library, TRUE) . '</pre>');
$this->assertEquals($library, $expected, 'Pre-load and post-load callbacks were applied correctly.'); $this->assertEquals($library, $expected, 'Pre-load and post-load callbacks were applied correctly.');
// This is not recommended usually and is only used for testing purposes. // This is not recommended usually and is only used for testing purposes.
drupal_static_reset('libraries_load'); drupal_static_reset('libraries_load');
...@@ -393,8 +393,8 @@ class LibrariesWebTest extends BrowserTestBase { ...@@ -393,8 +393,8 @@ class LibrariesWebTest extends BrowserTestBase {
$expected['pre-detect callback'] = 'applied (version 1, variant example_variant)'; $expected['pre-detect callback'] = 'applied (version 1, variant example_variant)';
$expected['post-detect callback'] = 'applied (variant example_variant)'; $expected['post-detect callback'] = 'applied (variant example_variant)';
$library = libraries_load('example_callback', 'example_variant'); $library = libraries_load('example_callback', 'example_variant');
$this->verbose('Expected:<pre>' . var_export($expected, TRUE) . '</pre>'); dump('Expected:<pre>' . var_export($expected, TRUE) . '</pre>');
$this->verbose('Actual:<pre>' . var_export($library, TRUE) . '</pre>'); dump('Actual:<pre>' . var_export($library, TRUE) . '</pre>');
$this->assertEquals($library, $expected, 'Pre-detect and post-detect callbacks were applied correctly to a variant.'); $this->assertEquals($library, $expected, 'Pre-detect and post-detect callbacks were applied correctly to a variant.');
} }
...@@ -414,9 +414,9 @@ class LibrariesWebTest extends BrowserTestBase { ...@@ -414,9 +414,9 @@ class LibrariesWebTest extends BrowserTestBase {
// Test loading of integration files. // Test loading of integration files.
$this->drupalGet('libraries_test/integration_files'); $this->drupalGet('libraries_test/integration_files');
$this->assertRaw('libraries_test.js', 'Integration file loading: libraries_test.js found'); $this->assertSession()->responseContains('libraries_test.js', 'Integration file loading: libraries_test.js found');
$this->assertRaw('libraries_test.css', 'Integration file loading: libraries_test.css found'); $this->assertSession()->responseContains('libraries_test.css', 'Integration file loading: libraries_test.css found');
$this->assertRaw('libraries_test.inc', 'Integration file loading: libraries_test.inc found'); $this->assertSession()->responseContains('libraries_test.inc', 'Integration file loading: libraries_test.inc found');
// Test version overloading. // Test version overloading.
$this->drupalGet('libraries_test/versions'); $this->drupalGet('libraries_test/versions');
...@@ -436,19 +436,19 @@ class LibrariesWebTest extends BrowserTestBase { ...@@ -436,19 +436,19 @@ class LibrariesWebTest extends BrowserTestBase {
// When the library information is not cached, all callback groups should be // When the library information is not cached, all callback groups should be
// invoked. // invoked.
$this->drupalGet('libraries_test/cache'); $this->drupalGet('libraries_test/cache');
$this->assertRaw('The <em>info</em> callback group was invoked.', 'Info callback invoked for uncached libraries.'); $this->assertSession()->responseContains('The <em>info</em> callback group was invoked.', 'Info callback invoked for uncached libraries.');
$this->assertRaw('The <em>pre-detect</em> callback group was invoked.', 'Pre-detect callback invoked for uncached libraries.'); $this->assertSession()->responseContains('The <em>pre-detect</em> callback group was invoked.', 'Pre-detect callback invoked for uncached libraries.');
$this->assertRaw('The <em>post-detect</em> callback group was invoked.', 'Post-detect callback invoked for uncached libraries.'); $this->assertSession()->responseContains('The <em>post-detect</em> callback group was invoked.', 'Post-detect callback invoked for uncached libraries.');
$this->assertRaw('The <em>pre-load</em> callback group was invoked.', 'Pre-load callback invoked for uncached libraries.'); $this->assertSession()->responseContains('The <em>pre-load</em> callback group was invoked.', 'Pre-load callback invoked for uncached libraries.');
$this->assertRaw('The <em>post-load</em> callback group was invoked.', 'Post-load callback invoked for uncached libraries.'); $this->assertSession()->responseContains('The <em>post-load</em> callback group was invoked.', 'Post-load callback invoked for uncached libraries.');
// When the library information is cached only the 'pre-load' and // When the library information is cached only the 'pre-load' and
// 'post-load' callback groups should be invoked. // 'post-load' callback groups should be invoked.
$this->drupalGet('libraries_test/cache'); $this->drupalGet('libraries_test/cache');
$this->assertNoRaw('The <em>info</em> callback group was not invoked.', 'Info callback not invoked for cached libraries.'); $this->assertSession()->responseNotContains('The <em>info</em> callback group was not invoked.', 'Info callback not invoked for cached libraries.');
$this->assertNoRaw('The <em>pre-detect</em> callback group was not invoked.', 'Pre-detect callback not invoked for cached libraries.'); $this->assertSession()->responseNotContains('The <em>pre-detect</em> callback group was not invoked.', 'Pre-detect callback not invoked for cached libraries.');
$this->assertNoRaw('The <em>post-detect</em> callback group was not invoked.', 'Post-detect callback not invoked for cached libraries.'); $this->assertSession()->responseNotContains('The <em>post-detect</em> callback group was not invoked.', 'Post-detect callback not invoked for cached libraries.');
$this->assertRaw('The <em>pre-load</em> callback group was invoked.', 'Pre-load callback invoked for cached libraries.'); $this->assertSession()->responseContains('The <em>pre-load</em> callback group was invoked.', 'Pre-load callback invoked for cached libraries.');
$this->assertRaw('The <em>post-load</em> callback group was invoked.', 'Post-load callback invoked for cached libraries.'); $this->assertSession()->responseContains('The <em>post-load</em> callback group was invoked.', 'Post-load callback invoked for cached libraries.');
\Drupal::state()->set('libraries_test.cache', FALSE); \Drupal::state()->set('libraries_test.cache', FALSE);
} }
...@@ -517,18 +517,18 @@ class LibrariesWebTest extends BrowserTestBase { ...@@ -517,18 +517,18 @@ class LibrariesWebTest extends BrowserTestBase {
$raw = $prefix . $filepath . $suffix; $raw = $prefix . $filepath . $suffix;
if ($expected) { if ($expected) {
$html_expected[] = Html::escape($raw); $html_expected[] = Html::escape($raw);
$this->assertRaw($raw, "$label$name.$extension found."); $this->assertSession()->responseContains($raw, "$label$name.$extension found.");
} }
else { else {
$html_not_expected[] = Html::escape($raw); $html_not_expected[] = Html::escape($raw);
$this->assertNoRaw($raw, "$label$name.$extension not found."); $this->assertSession()->responseNotContains($raw, "$label$name.$extension not found.");
} }
} }
} }
$html_expected = '<ul><li><pre>' . implode('</pre></li><li><pre>', $html_expected) . '</pre></li></ul>'; $html_expected = '<ul><li><pre>' . implode('</pre></li><li><pre>', $html_expected) . '</pre></li></ul>';
$html_not_expected = '<ul><li><pre>' . implode('</pre></li><li><pre>', $html_not_expected) . '</pre></li></ul>'; $html_not_expected = '<ul><li><pre>' . implode('</pre></li><li><pre>', $html_not_expected) . '</pre></li></ul>';
$this->verbose("Strings of HTML that are expected to be present:{$html_expected}Strings of HTML that are expected to not be present:{$html_not_expected}"); dump("Strings of HTML that are expected to be present:{$html_expected}Strings of HTML that are expected to not be present:{$html_not_expected}");
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment