Commit Graph

42 Commits

Author SHA1 Message Date
Tom Klingenberg
e991c595b8 [Console] Improved checks for InputArgument and InputOption constructor's $mode parameter.
Check that $mode in InputArgument::__construct() is not below 1 to actually look if any of the flags are set.
Check that $mode in InputOption::__construct() is not below 1 to actually look if any of the flags are set.
Check for the correct parameter type, as in InputOption (integer).
InputArgumentTest: Added test for negative integer $mode parameter input in constructor.
InputOptionTest: Added test for negative integer $mode parameter input in constructor.
2011-08-31 23:53:00 +02:00
stloyd
9f662634fe [Console] Fix fixtures from failing tests 2011-08-07 10:00:06 +02:00
Arnout Boks
04d0b6c821 [Console] Forced undecorated output in tests that rely on Application/Command-output being equal to a fixed value 2011-07-22 21:06:35 +02:00
everzet
e49d61f86e [Console] fixed console help printing expectations 2011-07-06 15:43:58 +03:00
Fabien Potencier
e293fb7abe fixed unit tests 2011-07-04 21:33:54 +02:00
Fabien Potencier
5744b520f7 [Console] added unit tests for DialogHelper 2011-06-20 19:05:56 +02:00
Gábor Egyed
3cfff4bfbe [Console] fixed output formatter if content has line breaks 2011-06-18 02:07:44 +02:00
stloyd
edf4b87dcb Add missing "tearDown" functions, and some missing variable declaration (this saves for me almost 20MB when run all tests)
Force AsseticBundle tests to use TestCase
Fix test for DoctrineBundle to use TestCase
2011-06-16 15:06:36 +02:00
Fabien Potencier
17cd08dc6c fixed CS 2011-06-08 19:56:59 +02:00
Fabien Potencier
740b2ac833 [Console] added a --no-ansi option for disable ANSI output (closes #1238) 2011-06-08 10:26:48 +02:00
Fabien Potencier
c6cfd3aeb1 Merge remote branch 'Herzult/fixArrayOption'
* Herzult/fixArrayOption:
  Simplify conditional block
  [Command] Fix array option parsing
2011-06-07 19:55:53 +02:00
Fabien Potencier
d84728e278 [Console] removed the ? alias for help and fix a few bugs from the previous commit 2011-06-07 18:26:00 +02:00
Fabien Potencier
facff73049 made the console tool more powerful
* The command names have now full support for nested namespaces. It means
   that abbreviations work for each sub-namespace:

        ./app/console doctrine:mapping:info

        # worked before
        ./app/console doctrine:map:in

        # works now
        ./app/console doc:map:in

 * Aliases are now first class citizen. They can have their own namespace,
   like the main name. So, now, there is no difference between an alias and a
   name.

 * As names and aliases can be namespaced, the Command::getFullName() and
   Command::getNamespace() method have been removed.
2011-06-07 17:51:43 +02:00
Antoine Hérault
fb051b2f98 [Command] Fix array option parsing 2011-06-07 14:58:11 +02:00
Fabien Potencier
18c3049fad Merge remote branch 'brikou/console_formatter_helper'
* brikou/console_formatter_helper:
  added mb_detect_encoding when formatting block (usefull when mb_internal_encoding is not properly set)
2011-06-04 18:19:11 +02:00
Fabien Potencier
79c6dc7937 [Console] fixed nested styles 2011-06-03 22:48:04 +02:00
Brikou CARRE
597a646347 added mb_detect_encoding when formatting block (usefull when mb_internal_encoding is not properly set) 2011-06-02 13:20:51 +02:00
Fabien Potencier
15bede5a63 [Console] refactored style management
The current code was broken when a style was defined inline:

  <bg=black>Foo</bg=black>

When creatin a new style formatter, it's better to let the formatter
apply the style to the text.
2011-05-23 16:54:36 +02:00
Fabien Potencier
ad4a0bda1c [Console] changed returned value of CommandTester to the command exit code 2011-04-03 22:30:40 +02:00
Fabien Potencier
8cb400a5d8 [Console] fixed a test 2011-03-24 14:03:56 +01:00
ever.zet
8b55c239a2 [Console] updated output tests after formatter adding 2011-03-17 17:53:28 +02:00
ever.zet
4fe2efd49e [Console] implemented output formatter to decorate and format output messages 2011-03-17 17:51:49 +02:00
ever.zet
e5700b817b [Console] implemented output formatter style class for defining custom styles 2011-03-17 17:51:25 +02:00
ever.zet
5ec8f47d7c if proper style not found, then this is a tag - no need in Exception 2011-03-12 11:55:44 +02:00
ever.zet
9cc3e1bd87 added ability to clear TestConsole 2011-03-12 11:55:01 +02:00
Fabien Potencier
b940cc6f40 moved most protected to private in the Console component 2011-03-11 12:53:42 +01:00
Fabien Potencier
c2e9dd27b2 [Console] fixed synopsis when an error occurs 2011-03-11 11:51:05 +01:00
Fabien Potencier
8c423edfef replaced symfony-project.org by symfony.com 2011-03-06 12:40:06 +01:00
Pascal Borreli
3a47fa6eed [Tests] Fixed Typo 2011-03-01 18:58:08 +01:00
Degory Valentine
057e86161e added test to verify ArgvInput->parse() failure with array input definition 2011-02-28 17:16:58 +01:00
Lukas Kahwe Smith
4b3c49550f issues found by static code analysis 2011-02-27 19:34:02 +01:00
Kris Wallsmith
36ff9abe67 [Console] fixed new ArgvInput method 2011-02-12 21:51:34 +01:00
Dominique Bongiraud
64fb94c725 normalized license messages in PHP files 2011-01-18 08:07:46 +01:00
Martin Hason
f41654fd60 [Console] added rendering previous exceptions 2011-01-11 14:52:32 +01:00
Kris Wallsmith
3e02eafc70 Fixed visibility of PHPUnit setUp and tearDown methods. 2010-12-06 15:52:23 +01:00
Ryan Weaver
7efb4630b8 [Command] Changing the InputOption::PARAMETER_* constants to InputOption::VALUE_* to more accurately reflect that these constants refer to the value or lack of value assigned to a particular option (e.g. --verbose or --em=doctrine).
To keep language consistent, three methods were changed in InputOption:

 * `InputOption::acceptParameter()` -> `InputOption::acceptValue()`
 * `InputOption::isParameterRequired()` -> InputOption::isValueRequired()`
 * `InputOption::isParameterOptional()` -> `InputOption::isValueOptional()`

The InputDefinition::asXml() method was also modified to update the `accept_value` and `is_value_required` attributes.
2010-11-27 19:56:27 +01:00
Ryan Weaver
9c8cae24f8 [Console] Fixing incorrect constant references in InputArgumentTest. 2010-11-27 19:56:19 +01:00
Fabien Potencier
944d91c1df made some method name changes to have a better coherence throughout the framework
When an object has a "main" many relation with related "things" (objects,
parameters, ...), the method names are normalized:

 * get()
 * set()
 * all()
 * replace()
 * remove()
 * clear()
 * isEmpty()
 * add()
 * register()
 * count()
 * keys()

The classes below follow this method naming convention:

 * BrowserKit\CookieJar -> Cookie
 * BrowserKit\History -> Request
 * Console\Application -> Command
 * Console\Application\Helper\HelperSet -> HelperInterface
 * DependencyInjection\Container -> services
 * DependencyInjection\ContainerBuilder -> services
 * DependencyInjection\ParameterBag\ParameterBag -> parameters
 * DependencyInjection\ParameterBag\FrozenParameterBag -> parameters
 * DomCrawler\Form -> FormField
 * EventDispatcher\Event -> parameters
 * Form\FieldGroup -> Field
 * HttpFoundation\HeaderBag -> headers
 * HttpFoundation\ParameterBag -> parameters
 * HttpFoundation\Session -> attributes
 * HttpKernel\Profiler\Profiler -> DataCollectorInterface
 * Routing\RouteCollection -> Route
 * Security\Authentication\AuthenticationProviderManager -> AuthenticationProviderInterface
 * Templating\Engine -> HelperInterface
 * Translation\MessageCatalogue -> messages

The usage of these methods are only allowed when it is clear that there is a
main relation:

 * a CookieJar has many Cookies;

 * a Container has many services and many parameters (as services is the main
   relation, we use the naming convention for this relation);

 * a Console Input has many arguments and many options. There is no "main"
   relation, and so the naming convention does not apply.

For many relations where the convention does not apply, the following methods
must be used instead (where XXX is the name of the related thing):

 * get()      -> getXXX()
 * set()      -> setXXX()
 * all()      -> getXXXs()
 * replace()  -> setXXXs()
 * remove()   -> removeXXX()
 * clear()    -> clearXXX()
 * isEmpty()  -> isEmptyXXX()
 * add()      -> addXXX()
 * register() -> registerXXX()
 * count()    -> countXXX()
 * keys()
2010-11-25 17:30:06 +01:00
Jordi Boggiano
a0f933163f [Console] Fixing tests breaking on windows 2010-11-18 06:59:01 +01:00
Fabien Pennequin
61f18667f4 [Console] Added some tests for command shortcuts 2010-09-14 09:18:50 +02:00
Fabien Pennequin
56935f85df [Console] Fixed invalid help command shortcut 2010-09-14 09:18:47 +02:00
Fabien Potencier
bf82cf42dd renamed Symfony\Components to Symfony\Component 2010-08-20 23:09:55 +02:00