Update Composer, update everything
This commit is contained in:
parent
ea3e94409f
commit
dda5c284b6
19527 changed files with 1135420 additions and 351004 deletions
55
vendor/drupal/console/Test/Helper/StringHelperTest.php
vendored
Normal file
55
vendor/drupal/console/Test/Helper/StringHelperTest.php
vendored
Normal file
|
@ -0,0 +1,55 @@
|
|||
<?php
|
||||
namespace Drupal\Console\Test\Helper;
|
||||
|
||||
use Drupal\Console\Helper\StringHelper;
|
||||
|
||||
class StringHelperTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/* @var $stringHelper */
|
||||
protected $stringHelper;
|
||||
|
||||
protected function setUp()
|
||||
{
|
||||
$this->stringHelper = new StringHelper();
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider getDataNames
|
||||
*/
|
||||
public function testCreateMachineName($input, $machine_name)
|
||||
{
|
||||
$this->assertEquals($this->stringHelper->createMachineName($input), $machine_name);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider getDataCamelCaseNames
|
||||
*/
|
||||
public function testCamelCaseToMachineName($camel_case, $machine_name)
|
||||
{
|
||||
$this->assertEquals($this->stringHelper->camelCaseToMachineName($camel_case), $machine_name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Random strings and their equivalent machine-name
|
||||
*/
|
||||
public function getDataNames()
|
||||
{
|
||||
return [
|
||||
['Test Space between words', 'test_space_between_words'],
|
||||
['test$special*characters!', 'test_special_characters'],
|
||||
['URL', 'url'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Camel-case strings and their equivalent machine-name
|
||||
*/
|
||||
public function getDataCamelCaseNames()
|
||||
{
|
||||
return [
|
||||
['camelCase', 'camel_case'],
|
||||
['greatestFunctionEverWritten', 'greatest_function_ever_written'],
|
||||
['WakeUp', 'wake_up'],
|
||||
];
|
||||
}
|
||||
}
|
Reference in a new issue