| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- <?php
- /**
- * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
- * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
- *
- * Licensed under The MIT License
- * For full copyright and license information, please see the LICENSE.txt
- * Redistributions of files must retain the above copyright notice.
- *
- * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
- * @link https://cakephp.org CakePHP(tm) Project
- * @since 3.6.0
- * @license https://opensource.org/licenses/mit-license.php MIT License
- */
- namespace Cake\Test\TestSuite\Console;
- use Cake\Console\Arguments;
- use Cake\TestSuite\TestCase;
- /**
- * Arguments test case.
- */
- class ArgumentsTest extends TestCase
- {
- /**
- * Get all arguments
- *
- * @return void
- */
- public function testGetArguments()
- {
- $values = ['big', 'brown', 'bear'];
- $args = new Arguments($values, []);
- $this->assertSame($values, $args->getArguments());
- }
- /**
- * Get arguments by index
- *
- * @return void
- */
- public function testGetArgumentAt()
- {
- $values = ['big', 'brown', 'bear'];
- $args = new Arguments($values, []);
- $this->assertSame($values[0], $args->getArgumentAt(0));
- $this->assertSame($values[1], $args->getArgumentAt(1));
- $this->assertNull($args->getArgumentAt(3));
- }
- /**
- * check arguments by index
- *
- * @return void
- */
- public function testHasArgumentAt()
- {
- $values = ['big', 'brown', 'bear'];
- $args = new Arguments($values, []);
- $this->assertTrue($args->hasArgumentAt(0));
- $this->assertTrue($args->hasArgumentAt(1));
- $this->assertFalse($args->hasArgumentAt(3));
- }
- }
|