├── 33 ├── .gitattributes ├── .gitignore ├── CONTRIBUTING.md ├── app ├── Acme │ └── Console │ │ ├── CommandGenerator.php │ │ ├── CommandInput.php │ │ └── CommandInputParser.php ├── commands │ ├── .gitkeep │ ├── CommanderGenerateCommand.php │ └── templates │ │ └── command.template ├── config │ ├── app.php │ ├── auth.php │ ├── cache.php │ ├── compile.php │ ├── database.php │ ├── local │ │ ├── app.php │ │ └── database.php │ ├── mail.php │ ├── packages │ │ └── .gitkeep │ ├── queue.php │ ├── remote.php │ ├── services.php │ ├── session.php │ ├── testing │ │ ├── cache.php │ │ └── session.php │ ├── view.php │ └── workbench.php ├── controllers │ ├── .gitkeep │ ├── BaseController.php │ └── HomeController.php ├── database │ ├── .gitignore │ ├── migrations │ │ └── .gitkeep │ └── seeds │ │ ├── .gitkeep │ │ └── DatabaseSeeder.php ├── filters.php ├── lang │ └── en │ │ ├── pagination.php │ │ ├── reminders.php │ │ └── validation.php ├── models │ └── User.php ├── routes.php ├── start │ ├── artisan.php │ ├── global.php │ └── local.php ├── storage │ ├── .gitignore │ ├── cache │ │ └── .gitignore │ ├── logs │ │ └── .gitignore │ ├── meta │ │ └── .gitignore │ ├── sessions │ │ └── .gitignore │ └── views │ │ └── .gitignore ├── tests │ ├── ExampleTest.php │ └── TestCase.php └── views │ ├── emails │ └── auth │ │ └── reminder.blade.php │ └── hello.php ├── artisan ├── bootstrap ├── autoload.php ├── paths.php └── start.php ├── codeception.yml ├── composer.json ├── foo ├── phpspec.yml ├── phpunit.xml ├── public ├── .htaccess ├── favicon.ico ├── index.php ├── packages │ └── .gitkeep └── robots.txt ├── readme.md ├── server.php ├── spec └── Acme │ └── Console │ ├── CommandGeneratorSpec.php │ └── CommandInputParserSpec.php └── tests ├── _bootstrap.php ├── _data └── dump.sql ├── _support ├── AcceptanceHelper.php ├── FunctionalHelper.php └── UnitHelper.php ├── acceptance.suite.yml ├── acceptance ├── AcceptanceTester.php ├── CommandGeneratorCept.php ├── _bootstrap.php └── stubs │ └── FooCommand.stub ├── functional.suite.yml ├── functional ├── FunctionalTester.php └── _bootstrap.php ├── unit.suite.yml └── unit ├── UnitTester.php └── _bootstrap.php /33: -------------------------------------------------------------------------------- 1 | bar = $bar; 12 | $this->baz = $baz; 13 | } 14 | 15 | } -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /bootstrap/compiled.php 2 | /vendor 3 | composer.phar 4 | composer.lock 5 | .env.*.php 6 | .env.php 7 | .DS_Store 8 | Thumbs.db 9 | .idea 10 | 11 | tests/_output/* 12 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contribution Guidelines 2 | 3 | Please submit all issues and pull requests to the [laravel/framework](http://github.com/laravel/framework) repository! 4 | -------------------------------------------------------------------------------- /app/Acme/Console/CommandGenerator.php: -------------------------------------------------------------------------------- 1 | file = $file; 25 | $this->mustache = $mustache; 26 | } 27 | 28 | /** 29 | * @param CommandInput $input 30 | * @param $template 31 | * @param $destination 32 | */ 33 | public function make(CommandInput $input, $template, $destination) 34 | { 35 | $template = $this->file->get($template); 36 | 37 | $stub = $this->mustache->render($template, $input); 38 | 39 | $this->file->put($destination, $stub); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /app/Acme/Console/CommandInput.php: -------------------------------------------------------------------------------- 1 | name = $name; 28 | $this->namespace = $namespace; 29 | $this->properties = $properties; 30 | } 31 | 32 | /** 33 | * @return string 34 | */ 35 | public function arguments() 36 | { 37 | return implode(', ', array_map(function($property) 38 | { 39 | return '$' . $property; 40 | }, $this->properties)); 41 | } 42 | 43 | } -------------------------------------------------------------------------------- /app/Acme/Console/CommandInputParser.php: -------------------------------------------------------------------------------- 1 | parseProperties($properties); 19 | 20 | return new CommandInput($name, $namespace, $properties); 21 | } 22 | 23 | /** 24 | * Parse the properties into an array. 25 | * 26 | * @param $properties 27 | * @return array 28 | */ 29 | private function parseProperties($properties) 30 | { 31 | return preg_split('/ ?, ?/', $properties, null, PREG_SPLIT_NO_EMPTY); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /app/commands/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laracasts/Build-Artisan-Commands-With-TDD/2406aa8fa5313973414cecf272e58847141d7353/app/commands/.gitkeep -------------------------------------------------------------------------------- /app/commands/CommanderGenerateCommand.php: -------------------------------------------------------------------------------- 1 | parser = $parser; 47 | $this->generator = $generator; 48 | } 49 | 50 | /** 51 | * Execute the console command. 52 | * 53 | * @return mixed 54 | */ 55 | public function fire() 56 | { 57 | // Parse the input for the Artisan command into a usable format. 58 | $input = $this->parser->parse( 59 | $this->argument('path'), 60 | $this->option('properties') 61 | ); 62 | 63 | // Actually create the file with the correct boilerplate. 64 | $this->generator->make( 65 | $input, 66 | app_path('commands/templates/command.template'), 67 | $this->getClassPath() 68 | ); 69 | 70 | // Notify the user. 71 | $this->info('All done!'); 72 | } 73 | 74 | /** 75 | * @return string 76 | */ 77 | private function getClassPath() 78 | { 79 | return sprintf("%s/%s.php", $this->option('base'), $this->argument('path')); 80 | } 81 | 82 | /** 83 | * Get the console command arguments. 84 | * 85 | * @return array 86 | */ 87 | protected function getArguments() 88 | { 89 | return [ 90 | ['path', InputArgument::REQUIRED, 'Path to the command class to generate.'] 91 | ]; 92 | } 93 | 94 | /** 95 | * Get the console command options. 96 | * 97 | * @return array 98 | */ 99 | protected function getOptions() 100 | { 101 | return [ 102 | ['properties', null, InputOption::VALUE_OPTIONAL, 'List of properties to build.', null], 103 | ['base', null, InputOption::VALUE_OPTIONAL, 'The base directory to begin from.', './app'] 104 | ]; 105 | } 106 | 107 | } 108 | -------------------------------------------------------------------------------- /app/commands/templates/command.template: -------------------------------------------------------------------------------- 1 | {{ . }} = ${{ . }}; 13 | {{/ properties}} 14 | } 15 | 16 | } -------------------------------------------------------------------------------- /app/config/app.php: -------------------------------------------------------------------------------- 1 | false, 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Application URL 21 | |-------------------------------------------------------------------------- 22 | | 23 | | This URL is used by the console to properly generate URLs when using 24 | | the Artisan command line tool. You should set this to the root of 25 | | your application so that it is used when running Artisan tasks. 26 | | 27 | */ 28 | 29 | 'url' => 'http://localhost', 30 | 31 | /* 32 | |-------------------------------------------------------------------------- 33 | | Application Timezone 34 | |-------------------------------------------------------------------------- 35 | | 36 | | Here you may specify the default timezone for your application, which 37 | | will be used by the PHP date and date-time functions. We have gone 38 | | ahead and set this to a sensible default for you out of the box. 39 | | 40 | */ 41 | 42 | 'timezone' => 'UTC', 43 | 44 | /* 45 | |-------------------------------------------------------------------------- 46 | | Application Locale Configuration 47 | |-------------------------------------------------------------------------- 48 | | 49 | | The application locale determines the default locale that will be used 50 | | by the translation service provider. You are free to set this value 51 | | to any of the locales which will be supported by the application. 52 | | 53 | */ 54 | 55 | 'locale' => 'en', 56 | 57 | /* 58 | |-------------------------------------------------------------------------- 59 | | Application Fallback Locale 60 | |-------------------------------------------------------------------------- 61 | | 62 | | The fallback locale determines the locale to use when the current one 63 | | is not available. You may change the value to correspond to any of 64 | | the language folders that are provided through your application. 65 | | 66 | */ 67 | 68 | 'fallback_locale' => 'en', 69 | 70 | /* 71 | |-------------------------------------------------------------------------- 72 | | Encryption Key 73 | |-------------------------------------------------------------------------- 74 | | 75 | | This key is used by the Illuminate encrypter service and should be set 76 | | to a random, 32 character string, otherwise these encrypted strings 77 | | will not be safe. Please do this before deploying an application! 78 | | 79 | */ 80 | 81 | 'key' => 'YourSecretKey!!!', 82 | 83 | 'cipher' => MCRYPT_RIJNDAEL_128, 84 | 85 | /* 86 | |-------------------------------------------------------------------------- 87 | | Autoloaded Service Providers 88 | |-------------------------------------------------------------------------- 89 | | 90 | | The service providers listed here will be automatically loaded on the 91 | | request to your application. Feel free to add your own services to 92 | | this array to grant expanded functionality to your applications. 93 | | 94 | */ 95 | 96 | 'providers' => array( 97 | 98 | 'Illuminate\Foundation\Providers\ArtisanServiceProvider', 99 | 'Illuminate\Auth\AuthServiceProvider', 100 | 'Illuminate\Cache\CacheServiceProvider', 101 | 'Illuminate\Session\CommandsServiceProvider', 102 | 'Illuminate\Foundation\Providers\ConsoleSupportServiceProvider', 103 | 'Illuminate\Routing\ControllerServiceProvider', 104 | 'Illuminate\Cookie\CookieServiceProvider', 105 | 'Illuminate\Database\DatabaseServiceProvider', 106 | 'Illuminate\Encryption\EncryptionServiceProvider', 107 | 'Illuminate\Filesystem\FilesystemServiceProvider', 108 | 'Illuminate\Hashing\HashServiceProvider', 109 | 'Illuminate\Html\HtmlServiceProvider', 110 | 'Illuminate\Log\LogServiceProvider', 111 | 'Illuminate\Mail\MailServiceProvider', 112 | 'Illuminate\Database\MigrationServiceProvider', 113 | 'Illuminate\Pagination\PaginationServiceProvider', 114 | 'Illuminate\Queue\QueueServiceProvider', 115 | 'Illuminate\Redis\RedisServiceProvider', 116 | 'Illuminate\Remote\RemoteServiceProvider', 117 | 'Illuminate\Auth\Reminders\ReminderServiceProvider', 118 | 'Illuminate\Database\SeedServiceProvider', 119 | 'Illuminate\Session\SessionServiceProvider', 120 | 'Illuminate\Translation\TranslationServiceProvider', 121 | 'Illuminate\Validation\ValidationServiceProvider', 122 | 'Illuminate\View\ViewServiceProvider', 123 | 'Illuminate\Workbench\WorkbenchServiceProvider', 124 | 125 | ), 126 | 127 | /* 128 | |-------------------------------------------------------------------------- 129 | | Service Provider Manifest 130 | |-------------------------------------------------------------------------- 131 | | 132 | | The service provider manifest is used by Laravel to lazy load service 133 | | providers which are not needed for each request, as well to keep a 134 | | list of all of the services. Here, you may set its storage spot. 135 | | 136 | */ 137 | 138 | 'manifest' => storage_path().'/meta', 139 | 140 | /* 141 | |-------------------------------------------------------------------------- 142 | | Class Aliases 143 | |-------------------------------------------------------------------------- 144 | | 145 | | This array of class aliases will be registered when this application 146 | | is started. However, feel free to register as many as you wish as 147 | | the aliases are "lazy" loaded so they don't hinder performance. 148 | | 149 | */ 150 | 151 | 'aliases' => array( 152 | 153 | 'App' => 'Illuminate\Support\Facades\App', 154 | 'Artisan' => 'Illuminate\Support\Facades\Artisan', 155 | 'Auth' => 'Illuminate\Support\Facades\Auth', 156 | 'Blade' => 'Illuminate\Support\Facades\Blade', 157 | 'Cache' => 'Illuminate\Support\Facades\Cache', 158 | 'ClassLoader' => 'Illuminate\Support\ClassLoader', 159 | 'Config' => 'Illuminate\Support\Facades\Config', 160 | 'Controller' => 'Illuminate\Routing\Controller', 161 | 'Cookie' => 'Illuminate\Support\Facades\Cookie', 162 | 'Crypt' => 'Illuminate\Support\Facades\Crypt', 163 | 'DB' => 'Illuminate\Support\Facades\DB', 164 | 'Eloquent' => 'Illuminate\Database\Eloquent\Model', 165 | 'Event' => 'Illuminate\Support\Facades\Event', 166 | 'File' => 'Illuminate\Support\Facades\File', 167 | 'Form' => 'Illuminate\Support\Facades\Form', 168 | 'Hash' => 'Illuminate\Support\Facades\Hash', 169 | 'HTML' => 'Illuminate\Support\Facades\HTML', 170 | 'Input' => 'Illuminate\Support\Facades\Input', 171 | 'Lang' => 'Illuminate\Support\Facades\Lang', 172 | 'Log' => 'Illuminate\Support\Facades\Log', 173 | 'Mail' => 'Illuminate\Support\Facades\Mail', 174 | 'Paginator' => 'Illuminate\Support\Facades\Paginator', 175 | 'Password' => 'Illuminate\Support\Facades\Password', 176 | 'Queue' => 'Illuminate\Support\Facades\Queue', 177 | 'Redirect' => 'Illuminate\Support\Facades\Redirect', 178 | 'Redis' => 'Illuminate\Support\Facades\Redis', 179 | 'Request' => 'Illuminate\Support\Facades\Request', 180 | 'Response' => 'Illuminate\Support\Facades\Response', 181 | 'Route' => 'Illuminate\Support\Facades\Route', 182 | 'Schema' => 'Illuminate\Support\Facades\Schema', 183 | 'Seeder' => 'Illuminate\Database\Seeder', 184 | 'Session' => 'Illuminate\Support\Facades\Session', 185 | 'SoftDeletingTrait' => 'Illuminate\Database\Eloquent\SoftDeletingTrait', 186 | 'SSH' => 'Illuminate\Support\Facades\SSH', 187 | 'Str' => 'Illuminate\Support\Str', 188 | 'URL' => 'Illuminate\Support\Facades\URL', 189 | 'Validator' => 'Illuminate\Support\Facades\Validator', 190 | 'View' => 'Illuminate\Support\Facades\View', 191 | 192 | ), 193 | 194 | ); 195 | -------------------------------------------------------------------------------- /app/config/auth.php: -------------------------------------------------------------------------------- 1 | 'eloquent', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Authentication Model 23 | |-------------------------------------------------------------------------- 24 | | 25 | | When using the "Eloquent" authentication driver, we need to know which 26 | | Eloquent model should be used to retrieve your users. Of course, it 27 | | is often just the "User" model but you may use whatever you like. 28 | | 29 | */ 30 | 31 | 'model' => 'User', 32 | 33 | /* 34 | |-------------------------------------------------------------------------- 35 | | Authentication Table 36 | |-------------------------------------------------------------------------- 37 | | 38 | | When using the "Database" authentication driver, we need to know which 39 | | table should be used to retrieve your users. We have chosen a basic 40 | | default value but you may easily change it to any table you like. 41 | | 42 | */ 43 | 44 | 'table' => 'users', 45 | 46 | /* 47 | |-------------------------------------------------------------------------- 48 | | Password Reminder Settings 49 | |-------------------------------------------------------------------------- 50 | | 51 | | Here you may set the settings for password reminders, including a view 52 | | that should be used as your password reminder e-mail. You will also 53 | | be able to set the name of the table that holds the reset tokens. 54 | | 55 | | The "expire" time is the number of minutes that the reminder should be 56 | | considered valid. This security feature keeps tokens short-lived so 57 | | they have less time to be guessed. You may change this as needed. 58 | | 59 | */ 60 | 61 | 'reminder' => array( 62 | 63 | 'email' => 'emails.auth.reminder', 64 | 65 | 'table' => 'password_reminders', 66 | 67 | 'expire' => 60, 68 | 69 | ), 70 | 71 | ); 72 | -------------------------------------------------------------------------------- /app/config/cache.php: -------------------------------------------------------------------------------- 1 | 'file', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | File Cache Location 23 | |-------------------------------------------------------------------------- 24 | | 25 | | When using the "file" cache driver, we need a location where the cache 26 | | files may be stored. A sensible default has been specified, but you 27 | | are free to change it to any other place on disk that you desire. 28 | | 29 | */ 30 | 31 | 'path' => storage_path().'/cache', 32 | 33 | /* 34 | |-------------------------------------------------------------------------- 35 | | Database Cache Connection 36 | |-------------------------------------------------------------------------- 37 | | 38 | | When using the "database" cache driver you may specify the connection 39 | | that should be used to store the cached items. When this option is 40 | | null the default database connection will be utilized for cache. 41 | | 42 | */ 43 | 44 | 'connection' => null, 45 | 46 | /* 47 | |-------------------------------------------------------------------------- 48 | | Database Cache Table 49 | |-------------------------------------------------------------------------- 50 | | 51 | | When using the "database" cache driver we need to know the table that 52 | | should be used to store the cached items. A default table name has 53 | | been provided but you're free to change it however you deem fit. 54 | | 55 | */ 56 | 57 | 'table' => 'cache', 58 | 59 | /* 60 | |-------------------------------------------------------------------------- 61 | | Memcached Servers 62 | |-------------------------------------------------------------------------- 63 | | 64 | | Now you may specify an array of your Memcached servers that should be 65 | | used when utilizing the Memcached cache driver. All of the servers 66 | | should contain a value for "host", "port", and "weight" options. 67 | | 68 | */ 69 | 70 | 'memcached' => array( 71 | 72 | array('host' => '127.0.0.1', 'port' => 11211, 'weight' => 100), 73 | 74 | ), 75 | 76 | /* 77 | |-------------------------------------------------------------------------- 78 | | Cache Key Prefix 79 | |-------------------------------------------------------------------------- 80 | | 81 | | When utilizing a RAM based store such as APC or Memcached, there might 82 | | be other applications utilizing the same cache. So, we'll specify a 83 | | value to get prefixed to all our keys so we can avoid collisions. 84 | | 85 | */ 86 | 87 | 'prefix' => 'laravel', 88 | 89 | ); 90 | -------------------------------------------------------------------------------- /app/config/compile.php: -------------------------------------------------------------------------------- 1 | PDO::FETCH_CLASS, 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Default Database Connection Name 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here you may specify which of the database connections below you wish 24 | | to use as your default connection for all database work. Of course 25 | | you may use many connections at once using the Database library. 26 | | 27 | */ 28 | 29 | 'default' => 'mysql', 30 | 31 | /* 32 | |-------------------------------------------------------------------------- 33 | | Database Connections 34 | |-------------------------------------------------------------------------- 35 | | 36 | | Here are each of the database connections setup for your application. 37 | | Of course, examples of configuring each database platform that is 38 | | supported by Laravel is shown below to make development simple. 39 | | 40 | | 41 | | All database work in Laravel is done through the PHP PDO facilities 42 | | so make sure you have the driver for your particular database of 43 | | choice installed on your machine before you begin development. 44 | | 45 | */ 46 | 47 | 'connections' => array( 48 | 49 | 'sqlite' => array( 50 | 'driver' => 'sqlite', 51 | 'database' => __DIR__.'/../database/production.sqlite', 52 | 'prefix' => '', 53 | ), 54 | 55 | 'mysql' => array( 56 | 'driver' => 'mysql', 57 | 'host' => 'localhost', 58 | 'database' => 'forge', 59 | 'username' => 'forge', 60 | 'password' => '', 61 | 'charset' => 'utf8', 62 | 'collation' => 'utf8_unicode_ci', 63 | 'prefix' => '', 64 | ), 65 | 66 | 'pgsql' => array( 67 | 'driver' => 'pgsql', 68 | 'host' => 'localhost', 69 | 'database' => 'forge', 70 | 'username' => 'forge', 71 | 'password' => '', 72 | 'charset' => 'utf8', 73 | 'prefix' => '', 74 | 'schema' => 'public', 75 | ), 76 | 77 | 'sqlsrv' => array( 78 | 'driver' => 'sqlsrv', 79 | 'host' => 'localhost', 80 | 'database' => 'database', 81 | 'username' => 'root', 82 | 'password' => '', 83 | 'prefix' => '', 84 | ), 85 | 86 | ), 87 | 88 | /* 89 | |-------------------------------------------------------------------------- 90 | | Migration Repository Table 91 | |-------------------------------------------------------------------------- 92 | | 93 | | This table keeps track of all the migrations that have already run for 94 | | your application. Using this information, we can determine which of 95 | | the migrations on disk haven't actually been run in the database. 96 | | 97 | */ 98 | 99 | 'migrations' => 'migrations', 100 | 101 | /* 102 | |-------------------------------------------------------------------------- 103 | | Redis Databases 104 | |-------------------------------------------------------------------------- 105 | | 106 | | Redis is an open source, fast, and advanced key-value store that also 107 | | provides a richer set of commands than a typical key-value systems 108 | | such as APC or Memcached. Laravel makes it easy to dig right in. 109 | | 110 | */ 111 | 112 | 'redis' => array( 113 | 114 | 'cluster' => false, 115 | 116 | 'default' => array( 117 | 'host' => '127.0.0.1', 118 | 'port' => 6379, 119 | 'database' => 0, 120 | ), 121 | 122 | ), 123 | 124 | ); 125 | -------------------------------------------------------------------------------- /app/config/local/app.php: -------------------------------------------------------------------------------- 1 | true, 17 | 18 | ); 19 | -------------------------------------------------------------------------------- /app/config/local/database.php: -------------------------------------------------------------------------------- 1 | array( 22 | 23 | 'mysql' => array( 24 | 'driver' => 'mysql', 25 | 'host' => 'localhost', 26 | 'database' => 'homestead', 27 | 'username' => 'homestead', 28 | 'password' => 'secret', 29 | 'charset' => 'utf8', 30 | 'collation' => 'utf8_unicode_ci', 31 | 'prefix' => '', 32 | ), 33 | 34 | 'pgsql' => array( 35 | 'driver' => 'pgsql', 36 | 'host' => 'localhost', 37 | 'database' => 'homestead', 38 | 'username' => 'homestead', 39 | 'password' => 'secret', 40 | 'charset' => 'utf8', 41 | 'prefix' => '', 42 | 'schema' => 'public', 43 | ), 44 | 45 | ), 46 | 47 | ); 48 | -------------------------------------------------------------------------------- /app/config/mail.php: -------------------------------------------------------------------------------- 1 | 'smtp', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | SMTP Host Address 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may provide the host address of the SMTP server used by your 26 | | applications. A default option is provided that is compatible with 27 | | the Mailgun mail service which will provide reliable deliveries. 28 | | 29 | */ 30 | 31 | 'host' => 'smtp.mailgun.org', 32 | 33 | /* 34 | |-------------------------------------------------------------------------- 35 | | SMTP Host Port 36 | |-------------------------------------------------------------------------- 37 | | 38 | | This is the SMTP port used by your application to deliver e-mails to 39 | | users of the application. Like the host we have set this value to 40 | | stay compatible with the Mailgun e-mail application by default. 41 | | 42 | */ 43 | 44 | 'port' => 587, 45 | 46 | /* 47 | |-------------------------------------------------------------------------- 48 | | Global "From" Address 49 | |-------------------------------------------------------------------------- 50 | | 51 | | You may wish for all e-mails sent by your application to be sent from 52 | | the same address. Here, you may specify a name and address that is 53 | | used globally for all e-mails that are sent by your application. 54 | | 55 | */ 56 | 57 | 'from' => array('address' => null, 'name' => null), 58 | 59 | /* 60 | |-------------------------------------------------------------------------- 61 | | E-Mail Encryption Protocol 62 | |-------------------------------------------------------------------------- 63 | | 64 | | Here you may specify the encryption protocol that should be used when 65 | | the application send e-mail messages. A sensible default using the 66 | | transport layer security protocol should provide great security. 67 | | 68 | */ 69 | 70 | 'encryption' => 'tls', 71 | 72 | /* 73 | |-------------------------------------------------------------------------- 74 | | SMTP Server Username 75 | |-------------------------------------------------------------------------- 76 | | 77 | | If your SMTP server requires a username for authentication, you should 78 | | set it here. This will get used to authenticate with your server on 79 | | connection. You may also set the "password" value below this one. 80 | | 81 | */ 82 | 83 | 'username' => null, 84 | 85 | /* 86 | |-------------------------------------------------------------------------- 87 | | SMTP Server Password 88 | |-------------------------------------------------------------------------- 89 | | 90 | | Here you may set the password required by your SMTP server to send out 91 | | messages from your application. This will be given to the server on 92 | | connection so that the application will be able to send messages. 93 | | 94 | */ 95 | 96 | 'password' => null, 97 | 98 | /* 99 | |-------------------------------------------------------------------------- 100 | | Sendmail System Path 101 | |-------------------------------------------------------------------------- 102 | | 103 | | When using the "sendmail" driver to send e-mails, we will need to know 104 | | the path to where Sendmail lives on this server. A default path has 105 | | been provided here, which will work well on most of your systems. 106 | | 107 | */ 108 | 109 | 'sendmail' => '/usr/sbin/sendmail -bs', 110 | 111 | /* 112 | |-------------------------------------------------------------------------- 113 | | Mail "Pretend" 114 | |-------------------------------------------------------------------------- 115 | | 116 | | When this option is enabled, e-mail will not actually be sent over the 117 | | web and will instead be written to your application's logs files so 118 | | you may inspect the message. This is great for local development. 119 | | 120 | */ 121 | 122 | 'pretend' => false, 123 | 124 | ); 125 | -------------------------------------------------------------------------------- /app/config/packages/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laracasts/Build-Artisan-Commands-With-TDD/2406aa8fa5313973414cecf272e58847141d7353/app/config/packages/.gitkeep -------------------------------------------------------------------------------- /app/config/queue.php: -------------------------------------------------------------------------------- 1 | 'sync', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Queue Connections 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may configure the connection information for each server that 26 | | is used by your application. A default configuration has been added 27 | | for each back-end shipped with Laravel. You are free to add more. 28 | | 29 | */ 30 | 31 | 'connections' => array( 32 | 33 | 'sync' => array( 34 | 'driver' => 'sync', 35 | ), 36 | 37 | 'beanstalkd' => array( 38 | 'driver' => 'beanstalkd', 39 | 'host' => 'localhost', 40 | 'queue' => 'default', 41 | 'ttr' => 60, 42 | ), 43 | 44 | 'sqs' => array( 45 | 'driver' => 'sqs', 46 | 'key' => 'your-public-key', 47 | 'secret' => 'your-secret-key', 48 | 'queue' => 'your-queue-url', 49 | 'region' => 'us-east-1', 50 | ), 51 | 52 | 'iron' => array( 53 | 'driver' => 'iron', 54 | 'host' => 'mq-aws-us-east-1.iron.io', 55 | 'token' => 'your-token', 56 | 'project' => 'your-project-id', 57 | 'queue' => 'your-queue-name', 58 | 'encrypt' => true, 59 | ), 60 | 61 | 'redis' => array( 62 | 'driver' => 'redis', 63 | 'queue' => 'default', 64 | ), 65 | 66 | ), 67 | 68 | /* 69 | |-------------------------------------------------------------------------- 70 | | Failed Queue Jobs 71 | |-------------------------------------------------------------------------- 72 | | 73 | | These options configure the behavior of failed queue job logging so you 74 | | can control which database and table are used to store the jobs that 75 | | have failed. You may change them to any database / table you wish. 76 | | 77 | */ 78 | 79 | 'failed' => array( 80 | 81 | 'database' => 'mysql', 'table' => 'failed_jobs', 82 | 83 | ), 84 | 85 | ); 86 | -------------------------------------------------------------------------------- /app/config/remote.php: -------------------------------------------------------------------------------- 1 | 'production', 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Remote Server Connections 21 | |-------------------------------------------------------------------------- 22 | | 23 | | These are the servers that will be accessible via the SSH task runner 24 | | facilities of Laravel. This feature radically simplifies executing 25 | | tasks on your servers, such as deploying out these applications. 26 | | 27 | */ 28 | 29 | 'connections' => array( 30 | 31 | 'production' => array( 32 | 'host' => '', 33 | 'username' => '', 34 | 'password' => '', 35 | 'key' => '', 36 | 'keyphrase' => '', 37 | 'root' => '/var/www', 38 | ), 39 | 40 | ), 41 | 42 | /* 43 | |-------------------------------------------------------------------------- 44 | | Remote Server Groups 45 | |-------------------------------------------------------------------------- 46 | | 47 | | Here you may list connections under a single group name, which allows 48 | | you to easily access all of the servers at once using a short name 49 | | that is extremely easy to remember, such as "web" or "database". 50 | | 51 | */ 52 | 53 | 'groups' => array( 54 | 55 | 'web' => array('production') 56 | 57 | ), 58 | 59 | ); 60 | -------------------------------------------------------------------------------- /app/config/services.php: -------------------------------------------------------------------------------- 1 | array( 18 | 'domain' => '', 19 | 'secret' => '', 20 | ), 21 | 22 | 'mandrill' => array( 23 | 'secret' => '', 24 | ), 25 | 26 | 'stripe' => array( 27 | 'model' => 'User', 28 | 'secret' => '', 29 | ), 30 | 31 | ); 32 | -------------------------------------------------------------------------------- /app/config/session.php: -------------------------------------------------------------------------------- 1 | 'file', 20 | 21 | /* 22 | |-------------------------------------------------------------------------- 23 | | Session Lifetime 24 | |-------------------------------------------------------------------------- 25 | | 26 | | Here you may specify the number of minutes that you wish the session 27 | | to be allowed to remain idle before it expires. If you want them 28 | | to immediately expire on the browser closing, set that option. 29 | | 30 | */ 31 | 32 | 'lifetime' => 120, 33 | 34 | 'expire_on_close' => false, 35 | 36 | /* 37 | |-------------------------------------------------------------------------- 38 | | Session File Location 39 | |-------------------------------------------------------------------------- 40 | | 41 | | When using the native session driver, we need a location where session 42 | | files may be stored. A default has been set for you but a different 43 | | location may be specified. This is only needed for file sessions. 44 | | 45 | */ 46 | 47 | 'files' => storage_path().'/sessions', 48 | 49 | /* 50 | |-------------------------------------------------------------------------- 51 | | Session Database Connection 52 | |-------------------------------------------------------------------------- 53 | | 54 | | When using the "database" or "redis" session drivers, you may specify a 55 | | connection that should be used to manage these sessions. This should 56 | | correspond to a connection in your database configuration options. 57 | | 58 | */ 59 | 60 | 'connection' => null, 61 | 62 | /* 63 | |-------------------------------------------------------------------------- 64 | | Session Database Table 65 | |-------------------------------------------------------------------------- 66 | | 67 | | When using the "database" session driver, you may specify the table we 68 | | should use to manage the sessions. Of course, a sensible default is 69 | | provided for you; however, you are free to change this as needed. 70 | | 71 | */ 72 | 73 | 'table' => 'sessions', 74 | 75 | /* 76 | |-------------------------------------------------------------------------- 77 | | Session Sweeping Lottery 78 | |-------------------------------------------------------------------------- 79 | | 80 | | Some session drivers must manually sweep their storage location to get 81 | | rid of old sessions from storage. Here are the chances that it will 82 | | happen on a given request. By default, the odds are 2 out of 100. 83 | | 84 | */ 85 | 86 | 'lottery' => array(2, 100), 87 | 88 | /* 89 | |-------------------------------------------------------------------------- 90 | | Session Cookie Name 91 | |-------------------------------------------------------------------------- 92 | | 93 | | Here you may change the name of the cookie used to identify a session 94 | | instance by ID. The name specified here will get used every time a 95 | | new session cookie is created by the framework for every driver. 96 | | 97 | */ 98 | 99 | 'cookie' => 'laravel_session', 100 | 101 | /* 102 | |-------------------------------------------------------------------------- 103 | | Session Cookie Path 104 | |-------------------------------------------------------------------------- 105 | | 106 | | The session cookie path determines the path for which the cookie will 107 | | be regarded as available. Typically, this will be the root path of 108 | | your application but you are free to change this when necessary. 109 | | 110 | */ 111 | 112 | 'path' => '/', 113 | 114 | /* 115 | |-------------------------------------------------------------------------- 116 | | Session Cookie Domain 117 | |-------------------------------------------------------------------------- 118 | | 119 | | Here you may change the domain of the cookie used to identify a session 120 | | in your application. This will determine which domains the cookie is 121 | | available to in your application. A sensible default has been set. 122 | | 123 | */ 124 | 125 | 'domain' => null, 126 | 127 | /* 128 | |-------------------------------------------------------------------------- 129 | | HTTPS Only Cookies 130 | |-------------------------------------------------------------------------- 131 | | 132 | | By setting this option to true, session cookies will only be sent back 133 | | to the server if the browser has a HTTPS connection. This will keep 134 | | the cookie from being sent to you if it can not be done securely. 135 | | 136 | */ 137 | 138 | 'secure' => false, 139 | 140 | ); 141 | -------------------------------------------------------------------------------- /app/config/testing/cache.php: -------------------------------------------------------------------------------- 1 | 'array', 19 | 20 | ); 21 | -------------------------------------------------------------------------------- /app/config/testing/session.php: -------------------------------------------------------------------------------- 1 | 'array', 20 | 21 | ); 22 | -------------------------------------------------------------------------------- /app/config/view.php: -------------------------------------------------------------------------------- 1 | array(__DIR__.'/../views'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Pagination View 21 | |-------------------------------------------------------------------------- 22 | | 23 | | This view will be used to render the pagination link output, and can 24 | | be easily customized here to show any view you like. A clean view 25 | | compatible with Twitter's Bootstrap is given to you by default. 26 | | 27 | */ 28 | 29 | 'pagination' => 'pagination::slider-3', 30 | 31 | ); 32 | -------------------------------------------------------------------------------- /app/config/workbench.php: -------------------------------------------------------------------------------- 1 | '', 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Workbench Author E-Mail Address 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Like the option above, your e-mail address is used when generating new 24 | | workbench packages. The e-mail is placed in your composer.json file 25 | | automatically after the package is created by the workbench tool. 26 | | 27 | */ 28 | 29 | 'email' => '', 30 | 31 | ); 32 | -------------------------------------------------------------------------------- /app/controllers/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laracasts/Build-Artisan-Commands-With-TDD/2406aa8fa5313973414cecf272e58847141d7353/app/controllers/.gitkeep -------------------------------------------------------------------------------- /app/controllers/BaseController.php: -------------------------------------------------------------------------------- 1 | layout)) 13 | { 14 | $this->layout = View::make($this->layout); 15 | } 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /app/controllers/HomeController.php: -------------------------------------------------------------------------------- 1 | call('UserTableSeeder'); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /app/filters.php: -------------------------------------------------------------------------------- 1 | '« Previous', 17 | 18 | 'next' => 'Next »', 19 | 20 | ); 21 | -------------------------------------------------------------------------------- /app/lang/en/reminders.php: -------------------------------------------------------------------------------- 1 | "Passwords must be at least six characters and match the confirmation.", 17 | 18 | "user" => "We can't find a user with that e-mail address.", 19 | 20 | "token" => "This password reset token is invalid.", 21 | 22 | "sent" => "Password reminder sent!", 23 | 24 | ); 25 | -------------------------------------------------------------------------------- /app/lang/en/validation.php: -------------------------------------------------------------------------------- 1 | "The :attribute must be accepted.", 17 | "active_url" => "The :attribute is not a valid URL.", 18 | "after" => "The :attribute must be a date after :date.", 19 | "alpha" => "The :attribute may only contain letters.", 20 | "alpha_dash" => "The :attribute may only contain letters, numbers, and dashes.", 21 | "alpha_num" => "The :attribute may only contain letters and numbers.", 22 | "array" => "The :attribute must be an array.", 23 | "before" => "The :attribute must be a date before :date.", 24 | "between" => array( 25 | "numeric" => "The :attribute must be between :min and :max.", 26 | "file" => "The :attribute must be between :min and :max kilobytes.", 27 | "string" => "The :attribute must be between :min and :max characters.", 28 | "array" => "The :attribute must have between :min and :max items.", 29 | ), 30 | "boolean" => "The :attribute field must be true or false", 31 | "confirmed" => "The :attribute confirmation does not match.", 32 | "date" => "The :attribute is not a valid date.", 33 | "date_format" => "The :attribute does not match the format :format.", 34 | "different" => "The :attribute and :other must be different.", 35 | "digits" => "The :attribute must be :digits digits.", 36 | "digits_between" => "The :attribute must be between :min and :max digits.", 37 | "email" => "The :attribute must be a valid email address.", 38 | "exists" => "The selected :attribute is invalid.", 39 | "image" => "The :attribute must be an image.", 40 | "in" => "The selected :attribute is invalid.", 41 | "integer" => "The :attribute must be an integer.", 42 | "ip" => "The :attribute must be a valid IP address.", 43 | "max" => array( 44 | "numeric" => "The :attribute may not be greater than :max.", 45 | "file" => "The :attribute may not be greater than :max kilobytes.", 46 | "string" => "The :attribute may not be greater than :max characters.", 47 | "array" => "The :attribute may not have more than :max items.", 48 | ), 49 | "mimes" => "The :attribute must be a file of type: :values.", 50 | "min" => array( 51 | "numeric" => "The :attribute must be at least :min.", 52 | "file" => "The :attribute must be at least :min kilobytes.", 53 | "string" => "The :attribute must be at least :min characters.", 54 | "array" => "The :attribute must have at least :min items.", 55 | ), 56 | "not_in" => "The selected :attribute is invalid.", 57 | "numeric" => "The :attribute must be a number.", 58 | "regex" => "The :attribute format is invalid.", 59 | "required" => "The :attribute field is required.", 60 | "required_if" => "The :attribute field is required when :other is :value.", 61 | "required_with" => "The :attribute field is required when :values is present.", 62 | "required_with_all" => "The :attribute field is required when :values is present.", 63 | "required_without" => "The :attribute field is required when :values is not present.", 64 | "required_without_all" => "The :attribute field is required when none of :values are present.", 65 | "same" => "The :attribute and :other must match.", 66 | "size" => array( 67 | "numeric" => "The :attribute must be :size.", 68 | "file" => "The :attribute must be :size kilobytes.", 69 | "string" => "The :attribute must be :size characters.", 70 | "array" => "The :attribute must contain :size items.", 71 | ), 72 | "unique" => "The :attribute has already been taken.", 73 | "url" => "The :attribute format is invalid.", 74 | 75 | /* 76 | |-------------------------------------------------------------------------- 77 | | Custom Validation Language Lines 78 | |-------------------------------------------------------------------------- 79 | | 80 | | Here you may specify custom validation messages for attributes using the 81 | | convention "attribute.rule" to name the lines. This makes it quick to 82 | | specify a specific custom language line for a given attribute rule. 83 | | 84 | */ 85 | 86 | 'custom' => array( 87 | 'attribute-name' => array( 88 | 'rule-name' => 'custom-message', 89 | ), 90 | ), 91 | 92 | /* 93 | |-------------------------------------------------------------------------- 94 | | Custom Validation Attributes 95 | |-------------------------------------------------------------------------- 96 | | 97 | | The following language lines are used to swap attribute place-holders 98 | | with something more reader friendly such as E-Mail Address instead 99 | | of "email". This simply helps us make messages a little cleaner. 100 | | 101 | */ 102 | 103 | 'attributes' => array(), 104 | 105 | ); 106 | -------------------------------------------------------------------------------- /app/models/User.php: -------------------------------------------------------------------------------- 1 | client->request('GET', '/'); 13 | 14 | $this->assertTrue($this->client->getResponse()->isOk()); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /app/tests/TestCase.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

Password Reset

8 | 9 |
10 | To reset your password, complete this form: {{ URL::to('password/reset', array($token)) }}.
11 | This link will expire in {{ Config::get('auth.reminder.expire', 60) }} minutes. 12 |
13 | 14 | 15 | -------------------------------------------------------------------------------- /app/views/hello.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Laravel PHP Framework 6 | 35 | 36 | 37 |
38 | Laravel PHP Framework 39 |

You have arrived.

40 |
41 | 42 | 43 | -------------------------------------------------------------------------------- /artisan: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | setRequestForConsoleEnvironment(); 45 | 46 | $artisan = Illuminate\Console\Application::start($app); 47 | 48 | /* 49 | |-------------------------------------------------------------------------- 50 | | Run The Artisan Application 51 | |-------------------------------------------------------------------------- 52 | | 53 | | When we run the console application, the current CLI command will be 54 | | executed in this console and the response sent back to a terminal 55 | | or another output device for the developers. Here goes nothing! 56 | | 57 | */ 58 | 59 | $status = $artisan->run(); 60 | 61 | /* 62 | |-------------------------------------------------------------------------- 63 | | Shutdown The Application 64 | |-------------------------------------------------------------------------- 65 | | 66 | | Once Artisan has finished running. We will fire off the shutdown events 67 | | so that any final work may be done by the application before we shut 68 | | down the process. This is the last thing to happen to the request. 69 | | 70 | */ 71 | 72 | $app->shutdown(); 73 | 74 | exit($status); 75 | -------------------------------------------------------------------------------- /bootstrap/autoload.php: -------------------------------------------------------------------------------- 1 | __DIR__.'/../app', 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Public Path 21 | |-------------------------------------------------------------------------- 22 | | 23 | | The public path contains the assets for your web application, such as 24 | | your JavaScript and CSS files, and also contains the primary entry 25 | | point for web requests into these applications from the outside. 26 | | 27 | */ 28 | 29 | 'public' => __DIR__.'/../public', 30 | 31 | /* 32 | |-------------------------------------------------------------------------- 33 | | Base Path 34 | |-------------------------------------------------------------------------- 35 | | 36 | | The base path is the root of the Laravel installation. Most likely you 37 | | will not need to change this value. But, if for some wild reason it 38 | | is necessary you will do so here, just proceed with some caution. 39 | | 40 | */ 41 | 42 | 'base' => __DIR__.'/..', 43 | 44 | /* 45 | |-------------------------------------------------------------------------- 46 | | Storage Path 47 | |-------------------------------------------------------------------------- 48 | | 49 | | The storage path is used by Laravel to store cached Blade views, logs 50 | | and other pieces of information. You may modify the path here when 51 | | you want to change the location of this directory for your apps. 52 | | 53 | */ 54 | 55 | 'storage' => __DIR__.'/../app/storage', 56 | 57 | ); 58 | -------------------------------------------------------------------------------- /bootstrap/start.php: -------------------------------------------------------------------------------- 1 | detectEnvironment(array( 28 | 29 | 'local' => array('homestead'), 30 | 31 | )); 32 | 33 | /* 34 | |-------------------------------------------------------------------------- 35 | | Bind Paths 36 | |-------------------------------------------------------------------------- 37 | | 38 | | Here we are binding the paths configured in paths.php to the app. You 39 | | should not be changing these here. If you need to change these you 40 | | may do so within the paths.php file and they will be bound here. 41 | | 42 | */ 43 | 44 | $app->bindInstallPaths(require __DIR__.'/paths.php'); 45 | 46 | /* 47 | |-------------------------------------------------------------------------- 48 | | Load The Application 49 | |-------------------------------------------------------------------------- 50 | | 51 | | Here we will load this Illuminate application. We will keep this in a 52 | | separate location so we can isolate the creation of an application 53 | | from the actual running of the application with a given request. 54 | | 55 | */ 56 | 57 | $framework = $app['path.base']. 58 | '/vendor/laravel/framework/src'; 59 | 60 | require $framework.'/Illuminate/Foundation/start.php'; 61 | 62 | /* 63 | |-------------------------------------------------------------------------- 64 | | Return The Application 65 | |-------------------------------------------------------------------------- 66 | | 67 | | This script returns the application instance. The instance is given to 68 | | the calling script so we can separate the building of the instances 69 | | from the actual running of the application and sending responses. 70 | | 71 | */ 72 | 73 | return $app; 74 | -------------------------------------------------------------------------------- /codeception.yml: -------------------------------------------------------------------------------- 1 | actor: Tester 2 | paths: 3 | tests: tests 4 | log: tests/_output 5 | data: tests/_data 6 | helpers: tests/_support 7 | settings: 8 | bootstrap: _bootstrap.php 9 | colors: true 10 | memory_limit: 1024M 11 | modules: 12 | config: 13 | Db: 14 | dsn: '' 15 | user: '' 16 | password: '' 17 | dump: tests/_data/dump.sql 18 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "laravel/laravel", 3 | "description": "The Laravel Framework.", 4 | "keywords": ["framework", "laravel"], 5 | "license": "MIT", 6 | "require": { 7 | "laravel/framework": "4.2.*", 8 | "mustache/mustache": "~2.6.0" 9 | }, 10 | "require-dev": { 11 | "phpspec/phpspec": "~2.0.0", 12 | "codeception/codeception": "~2.0.0" 13 | }, 14 | "autoload": { 15 | "classmap": [ 16 | "app/commands", 17 | "app/controllers", 18 | "app/models", 19 | "app/database/migrations", 20 | "app/database/seeds", 21 | "app/tests/TestCase.php" 22 | ], 23 | "psr-4": { 24 | "Acme\\": "app/Acme" 25 | } 26 | }, 27 | "scripts": { 28 | "post-install-cmd": [ 29 | "php artisan clear-compiled", 30 | "php artisan optimize" 31 | ], 32 | "post-update-cmd": [ 33 | "php artisan clear-compiled", 34 | "php artisan optimize" 35 | ], 36 | "post-create-project-cmd": [ 37 | "php artisan key:generate" 38 | ] 39 | }, 40 | "config": { 41 | "preferred-install": "dist" 42 | }, 43 | "minimum-stability": "stable" 44 | } 45 | -------------------------------------------------------------------------------- /foo: -------------------------------------------------------------------------------- 1 | bar = $bar; 12 | $this->baz = $baz; 13 | } 14 | 15 | } -------------------------------------------------------------------------------- /phpspec.yml: -------------------------------------------------------------------------------- 1 | suites: 2 | acme_suite: 3 | src_path: app -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 15 | ./app/tests/ 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /public/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | 3 | Options -MultiViews 4 | 5 | 6 | RewriteEngine On 7 | 8 | # Redirect Trailing Slashes... 9 | RewriteRule ^(.*)/$ /$1 [L,R=301] 10 | 11 | # Handle Front Controller... 12 | RewriteCond %{REQUEST_FILENAME} !-d 13 | RewriteCond %{REQUEST_FILENAME} !-f 14 | RewriteRule ^ index.php [L] 15 | 16 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laracasts/Build-Artisan-Commands-With-TDD/2406aa8fa5313973414cecf272e58847141d7353/public/favicon.ico -------------------------------------------------------------------------------- /public/index.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | 9 | /* 10 | |-------------------------------------------------------------------------- 11 | | Register The Auto Loader 12 | |-------------------------------------------------------------------------- 13 | | 14 | | Composer provides a convenient, automatically generated class loader 15 | | for our application. We just need to utilize it! We'll require it 16 | | into the script here so that we do not have to worry about the 17 | | loading of any our classes "manually". Feels great to relax. 18 | | 19 | */ 20 | 21 | require __DIR__.'/../bootstrap/autoload.php'; 22 | 23 | /* 24 | |-------------------------------------------------------------------------- 25 | | Turn On The Lights 26 | |-------------------------------------------------------------------------- 27 | | 28 | | We need to illuminate PHP development, so let's turn on the lights. 29 | | This bootstraps the framework and gets it ready for use, then it 30 | | will load up this application so that we can run it and send 31 | | the responses back to the browser and delight these users. 32 | | 33 | */ 34 | 35 | $app = require_once __DIR__.'/../bootstrap/start.php'; 36 | 37 | /* 38 | |-------------------------------------------------------------------------- 39 | | Run The Application 40 | |-------------------------------------------------------------------------- 41 | | 42 | | Once we have the application, we can simply call the run method, 43 | | which will execute the request and send the response back to 44 | | the client's browser allowing them to enjoy the creative 45 | | and wonderful application we have whipped up for them. 46 | | 47 | */ 48 | 49 | $app->run(); 50 | -------------------------------------------------------------------------------- /public/packages/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laracasts/Build-Artisan-Commands-With-TDD/2406aa8fa5313973414cecf272e58847141d7353/public/packages/.gitkeep -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | ## Laravel PHP Framework 2 | 3 | [![Build Status](https://travis-ci.org/laravel/framework.svg)](https://travis-ci.org/laravel/framework) 4 | [![Total Downloads](https://poser.pugx.org/laravel/framework/downloads.svg)](https://packagist.org/packages/laravel/framework) 5 | [![Latest Stable Version](https://poser.pugx.org/laravel/framework/v/stable.svg)](https://packagist.org/packages/laravel/framework) 6 | [![Latest Unstable Version](https://poser.pugx.org/laravel/framework/v/unstable.svg)](https://packagist.org/packages/laravel/framework) 7 | [![License](https://poser.pugx.org/laravel/framework/license.svg)](https://packagist.org/packages/laravel/framework) 8 | 9 | Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable, creative experience to be truly fulfilling. Laravel attempts to take the pain out of development by easing common tasks used in the majority of web projects, such as authentication, routing, sessions, and caching. 10 | 11 | Laravel aims to make the development process a pleasing one for the developer without sacrificing application functionality. Happy developers make the best code. To this end, we've attempted to combine the very best of what we have seen in other web frameworks, including frameworks implemented in other languages, such as Ruby on Rails, ASP.NET MVC, and Sinatra. 12 | 13 | Laravel is accessible, yet powerful, providing powerful tools needed for large, robust applications. A superb inversion of control container, expressive migration system, and tightly integrated unit testing support give you the tools you need to build any application with which you are tasked. 14 | 15 | ## Official Documentation 16 | 17 | Documentation for the entire framework can be found on the [Laravel website](http://laravel.com/docs). 18 | 19 | ### Contributing To Laravel 20 | 21 | **All issues and pull requests should be filed on the [laravel/framework](http://github.com/laravel/framework) repository.** 22 | 23 | ### License 24 | 25 | The Laravel framework is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT) 26 | -------------------------------------------------------------------------------- /server.php: -------------------------------------------------------------------------------- 1 | beConstructedWith($file, $mustache); 14 | } 15 | 16 | function it_is_initializable() 17 | { 18 | $this->shouldHaveType('Acme\Console\CommandGenerator'); 19 | } 20 | 21 | function it_generates_a_command_class(Filesystem $file, Mustache_Engine $mustache) 22 | { 23 | $input = new CommandInput('SomeCommand', 'Acme\Bar', ['name', 'email'], '$name, $email'); 24 | $template = 'foo.stub'; 25 | $destination = 'app/Acme/Bar/SomeCommand.php'; 26 | 27 | $file->get($template)->shouldBeCalled()->willReturn('template'); 28 | $mustache->render('template', $input)->shouldBeCalled()->willReturn('stub'); 29 | $file->put($destination, 'stub')->shouldBeCalled(); 30 | 31 | $this->make($input, $template, $destination); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /spec/Acme/Console/CommandInputParserSpec.php: -------------------------------------------------------------------------------- 1 | shouldHaveType('Acme\Console\CommandInputParser'); 11 | } 12 | 13 | function it_returns_an_instance_of_command_input() 14 | { 15 | $this->parse('Foo/Bar/MyCommand', 'username, email') 16 | ->shouldBeAnInstanceOf('Acme\Console\CommandInput'); 17 | } 18 | 19 | function it_parses_the_name_of_the_class() 20 | { 21 | $input = $this->parse('Foo/Bar/MyCommand', 'username, email'); 22 | 23 | $input->name->shouldBe('MyCommand'); 24 | } 25 | 26 | function it_parses_the_namespace_of_the_class() 27 | { 28 | $input = $this->parse('Foo/Bar/MyCommand', 'username, email'); 29 | 30 | $input->namespace->shouldBe('Foo\Bar'); 31 | } 32 | 33 | function it_parses_the_properties_for_the_class() 34 | { 35 | $input = $this->parse('Foo/Bar/MyCommand', 'username, email'); 36 | 37 | $input->properties->shouldBe(['username', 'email']); 38 | } 39 | 40 | 41 | } 42 | -------------------------------------------------------------------------------- /tests/_bootstrap.php: -------------------------------------------------------------------------------- 1 | scenario->runStep(new \Codeception\Step\Action('setHeader', func_get_args())); 37 | } 38 | 39 | 40 | /** 41 | * [!] Method is generated. Documentation taken from corresponding module. 42 | * 43 | * Sets 'url' configuration parameter to hosts subdomain. 44 | * It does not open a page on subdomain. Use `amOnPage` for that 45 | * 46 | * ``` php 47 | * amOnSubdomain('user'); 53 | * $I->amOnPage('/'); 54 | * // moves to http://user.mysite.com/ 55 | * ?> 56 | * ``` 57 | * 58 | * @param $subdomain 59 | * 60 | * @return mixed 61 | * @see \Codeception\Module\PhpBrowser::amOnSubdomain() 62 | */ 63 | public function amOnSubdomain($subdomain) { 64 | return $this->scenario->runStep(new \Codeception\Step\Condition('amOnSubdomain', func_get_args())); 65 | } 66 | 67 | 68 | /** 69 | * [!] Method is generated. Documentation taken from corresponding module. 70 | * 71 | * Low-level API method. 72 | * If Codeception commands are not enough, use [Guzzle HTTP Client](http://guzzlephp.org/) methods directly 73 | * 74 | * Example: 75 | * 76 | * ``` php 77 | * executeInGuzzle(function (\GuzzleHttp\Client $client) { 79 | * $client->get('/get', ['query' => ['foo' => 'bar']]); 80 | * }); 81 | * ?> 82 | * ``` 83 | * 84 | * It is not recommended to use this command on a regular basis. 85 | * If Codeception lacks important Guzzle Client methods, implement them and submit patches. 86 | * 87 | * @param callable $function 88 | * @see \Codeception\Module\PhpBrowser::executeInGuzzle() 89 | */ 90 | public function executeInGuzzle($function) { 91 | return $this->scenario->runStep(new \Codeception\Step\Action('executeInGuzzle', func_get_args())); 92 | } 93 | 94 | 95 | /** 96 | * [!] Method is generated. Documentation taken from corresponding module. 97 | * 98 | * Authenticates user for HTTP_AUTH 99 | * 100 | * @param $username 101 | * @param $password 102 | * @see \Codeception\Lib\InnerBrowser::amHttpAuthenticated() 103 | */ 104 | public function amHttpAuthenticated($username, $password) { 105 | return $this->scenario->runStep(new \Codeception\Step\Condition('amHttpAuthenticated', func_get_args())); 106 | } 107 | 108 | 109 | /** 110 | * [!] Method is generated. Documentation taken from corresponding module. 111 | * 112 | * Opens the page. 113 | * Requires relative uri as parameter 114 | * 115 | * Example: 116 | * 117 | * ``` php 118 | * amOnPage('/'); 121 | * // opens /register page 122 | * $I->amOnPage('/register'); 123 | * ?> 124 | * ``` 125 | * 126 | * @param $page 127 | * @see \Codeception\Lib\InnerBrowser::amOnPage() 128 | */ 129 | public function amOnPage($page) { 130 | return $this->scenario->runStep(new \Codeception\Step\Condition('amOnPage', func_get_args())); 131 | } 132 | 133 | 134 | /** 135 | * [!] Method is generated. Documentation taken from corresponding module. 136 | * 137 | * Perform a click on link or button. 138 | * Link or button are found by their names or CSS selector. 139 | * Submits a form if button is a submit type. 140 | * 141 | * If link is an image it's found by alt attribute value of image. 142 | * If button is image button is found by it's value 143 | * If link or button can't be found by name they are searched by CSS selector. 144 | * 145 | * The second parameter is a context: CSS or XPath locator to narrow the search. 146 | * 147 | * Examples: 148 | * 149 | * ``` php 150 | * click('Logout'); 153 | * // button of form 154 | * $I->click('Submit'); 155 | * // CSS button 156 | * $I->click('#form input[type=submit]'); 157 | * // XPath 158 | * $I->click('//form/*[@type=submit]'); 159 | * // link in context 160 | * $I->click('Logout', '#nav'); 161 | * // using strict locator 162 | * $I->click(['link' => 'Login']); 163 | * ?> 164 | * ``` 165 | * 166 | * @param $link 167 | * @param $context 168 | * @see \Codeception\Lib\InnerBrowser::click() 169 | */ 170 | public function click($link, $context = null) { 171 | return $this->scenario->runStep(new \Codeception\Step\Action('click', func_get_args())); 172 | } 173 | 174 | 175 | /** 176 | * [!] Method is generated. Documentation taken from corresponding module. 177 | * 178 | * Check if current page contains the text specified. 179 | * Specify the css selector to match only specific region. 180 | * 181 | * Examples: 182 | * 183 | * ``` php 184 | * see('Logout'); // I can suppose user is logged in 186 | * $I->see('Sign Up','h1'); // I can suppose it's a signup page 187 | * $I->see('Sign Up','//body/h1'); // with XPath 188 | * ?> 189 | * ``` 190 | * 191 | * @param $text 192 | * @param null $selector 193 | * Conditional Assertion: Test won't be stopped on fail 194 | * @see \Codeception\Lib\InnerBrowser::see() 195 | */ 196 | public function canSee($text, $selector = null) { 197 | return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('see', func_get_args())); 198 | } 199 | /** 200 | * [!] Method is generated. Documentation taken from corresponding module. 201 | * 202 | * Check if current page contains the text specified. 203 | * Specify the css selector to match only specific region. 204 | * 205 | * Examples: 206 | * 207 | * ``` php 208 | * see('Logout'); // I can suppose user is logged in 210 | * $I->see('Sign Up','h1'); // I can suppose it's a signup page 211 | * $I->see('Sign Up','//body/h1'); // with XPath 212 | * ?> 213 | * ``` 214 | * 215 | * @param $text 216 | * @param null $selector 217 | * @see \Codeception\Lib\InnerBrowser::see() 218 | */ 219 | public function see($text, $selector = null) { 220 | return $this->scenario->runStep(new \Codeception\Step\Assertion('see', func_get_args())); 221 | } 222 | 223 | 224 | /** 225 | * [!] Method is generated. Documentation taken from corresponding module. 226 | * 227 | * Check if current page doesn't contain the text specified. 228 | * Specify the css selector to match only specific region. 229 | * 230 | * Examples: 231 | * 232 | * ```php 233 | * dontSee('Login'); // I can suppose user is already logged in 235 | * $I->dontSee('Sign Up','h1'); // I can suppose it's not a signup page 236 | * $I->dontSee('Sign Up','//body/h1'); // with XPath 237 | * ?> 238 | * ``` 239 | * 240 | * @param $text 241 | * @param null $selector 242 | * Conditional Assertion: Test won't be stopped on fail 243 | * @see \Codeception\Lib\InnerBrowser::dontSee() 244 | */ 245 | public function cantSee($text, $selector = null) { 246 | return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSee', func_get_args())); 247 | } 248 | /** 249 | * [!] Method is generated. Documentation taken from corresponding module. 250 | * 251 | * Check if current page doesn't contain the text specified. 252 | * Specify the css selector to match only specific region. 253 | * 254 | * Examples: 255 | * 256 | * ```php 257 | * dontSee('Login'); // I can suppose user is already logged in 259 | * $I->dontSee('Sign Up','h1'); // I can suppose it's not a signup page 260 | * $I->dontSee('Sign Up','//body/h1'); // with XPath 261 | * ?> 262 | * ``` 263 | * 264 | * @param $text 265 | * @param null $selector 266 | * @see \Codeception\Lib\InnerBrowser::dontSee() 267 | */ 268 | public function dontSee($text, $selector = null) { 269 | return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSee', func_get_args())); 270 | } 271 | 272 | 273 | /** 274 | * [!] Method is generated. Documentation taken from corresponding module. 275 | * 276 | * Checks if there is a link with text specified. 277 | * Specify url to match link with exact this url. 278 | * 279 | * Examples: 280 | * 281 | * ``` php 282 | * seeLink('Logout'); // matches Logout 284 | * $I->seeLink('Logout','/logout'); // matches Logout 285 | * ?> 286 | * ``` 287 | * 288 | * @param $text 289 | * @param null $url 290 | * Conditional Assertion: Test won't be stopped on fail 291 | * @see \Codeception\Lib\InnerBrowser::seeLink() 292 | */ 293 | public function canSeeLink($text, $url = null) { 294 | return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeLink', func_get_args())); 295 | } 296 | /** 297 | * [!] Method is generated. Documentation taken from corresponding module. 298 | * 299 | * Checks if there is a link with text specified. 300 | * Specify url to match link with exact this url. 301 | * 302 | * Examples: 303 | * 304 | * ``` php 305 | * seeLink('Logout'); // matches Logout 307 | * $I->seeLink('Logout','/logout'); // matches Logout 308 | * ?> 309 | * ``` 310 | * 311 | * @param $text 312 | * @param null $url 313 | * @see \Codeception\Lib\InnerBrowser::seeLink() 314 | */ 315 | public function seeLink($text, $url = null) { 316 | return $this->scenario->runStep(new \Codeception\Step\Assertion('seeLink', func_get_args())); 317 | } 318 | 319 | 320 | /** 321 | * [!] Method is generated. Documentation taken from corresponding module. 322 | * 323 | * Checks if page doesn't contain the link with text specified. 324 | * Specify url to narrow the results. 325 | * 326 | * Examples: 327 | * 328 | * ``` php 329 | * dontSeeLink('Logout'); // I suppose user is not logged in 331 | * ?> 332 | * ``` 333 | * 334 | * @param $text 335 | * @param null $url 336 | * Conditional Assertion: Test won't be stopped on fail 337 | * @see \Codeception\Lib\InnerBrowser::dontSeeLink() 338 | */ 339 | public function cantSeeLink($text, $url = null) { 340 | return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeLink', func_get_args())); 341 | } 342 | /** 343 | * [!] Method is generated. Documentation taken from corresponding module. 344 | * 345 | * Checks if page doesn't contain the link with text specified. 346 | * Specify url to narrow the results. 347 | * 348 | * Examples: 349 | * 350 | * ``` php 351 | * dontSeeLink('Logout'); // I suppose user is not logged in 353 | * ?> 354 | * ``` 355 | * 356 | * @param $text 357 | * @param null $url 358 | * @see \Codeception\Lib\InnerBrowser::dontSeeLink() 359 | */ 360 | public function dontSeeLink($text, $url = null) { 361 | return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeLink', func_get_args())); 362 | } 363 | 364 | 365 | /** 366 | * [!] Method is generated. Documentation taken from corresponding module. 367 | * 368 | * Checks that current uri contains a value 369 | * 370 | * ``` php 371 | * seeInCurrentUrl('home'); 374 | * // to match: /users/1 375 | * $I->seeInCurrentUrl('/users/'); 376 | * ?> 377 | * ``` 378 | * 379 | * @param $uri 380 | * Conditional Assertion: Test won't be stopped on fail 381 | * @see \Codeception\Lib\InnerBrowser::seeInCurrentUrl() 382 | */ 383 | public function canSeeInCurrentUrl($uri) { 384 | return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeInCurrentUrl', func_get_args())); 385 | } 386 | /** 387 | * [!] Method is generated. Documentation taken from corresponding module. 388 | * 389 | * Checks that current uri contains a value 390 | * 391 | * ``` php 392 | * seeInCurrentUrl('home'); 395 | * // to match: /users/1 396 | * $I->seeInCurrentUrl('/users/'); 397 | * ?> 398 | * ``` 399 | * 400 | * @param $uri 401 | * @see \Codeception\Lib\InnerBrowser::seeInCurrentUrl() 402 | */ 403 | public function seeInCurrentUrl($uri) { 404 | return $this->scenario->runStep(new \Codeception\Step\Assertion('seeInCurrentUrl', func_get_args())); 405 | } 406 | 407 | 408 | /** 409 | * [!] Method is generated. Documentation taken from corresponding module. 410 | * 411 | * Checks that current uri does not contain a value 412 | * 413 | * ``` php 414 | * dontSeeInCurrentUrl('/users/'); 416 | * ?> 417 | * ``` 418 | * 419 | * @param $uri 420 | * Conditional Assertion: Test won't be stopped on fail 421 | * @see \Codeception\Lib\InnerBrowser::dontSeeInCurrentUrl() 422 | */ 423 | public function cantSeeInCurrentUrl($uri) { 424 | return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInCurrentUrl', func_get_args())); 425 | } 426 | /** 427 | * [!] Method is generated. Documentation taken from corresponding module. 428 | * 429 | * Checks that current uri does not contain a value 430 | * 431 | * ``` php 432 | * dontSeeInCurrentUrl('/users/'); 434 | * ?> 435 | * ``` 436 | * 437 | * @param $uri 438 | * @see \Codeception\Lib\InnerBrowser::dontSeeInCurrentUrl() 439 | */ 440 | public function dontSeeInCurrentUrl($uri) { 441 | return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeInCurrentUrl', func_get_args())); 442 | } 443 | 444 | 445 | /** 446 | * [!] Method is generated. Documentation taken from corresponding module. 447 | * 448 | * Checks that current url is equal to value. 449 | * Unlike `seeInCurrentUrl` performs a strict check. 450 | * 451 | * ``` php 452 | * seeCurrentUrlEquals('/'); 455 | * ?> 456 | * ``` 457 | * 458 | * @param $uri 459 | * Conditional Assertion: Test won't be stopped on fail 460 | * @see \Codeception\Lib\InnerBrowser::seeCurrentUrlEquals() 461 | */ 462 | public function canSeeCurrentUrlEquals($uri) { 463 | return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeCurrentUrlEquals', func_get_args())); 464 | } 465 | /** 466 | * [!] Method is generated. Documentation taken from corresponding module. 467 | * 468 | * Checks that current url is equal to value. 469 | * Unlike `seeInCurrentUrl` performs a strict check. 470 | * 471 | * ``` php 472 | * seeCurrentUrlEquals('/'); 475 | * ?> 476 | * ``` 477 | * 478 | * @param $uri 479 | * @see \Codeception\Lib\InnerBrowser::seeCurrentUrlEquals() 480 | */ 481 | public function seeCurrentUrlEquals($uri) { 482 | return $this->scenario->runStep(new \Codeception\Step\Assertion('seeCurrentUrlEquals', func_get_args())); 483 | } 484 | 485 | 486 | /** 487 | * [!] Method is generated. Documentation taken from corresponding module. 488 | * 489 | * Checks that current url is not equal to value. 490 | * Unlike `dontSeeInCurrentUrl` performs a strict check. 491 | * 492 | * ``` php 493 | * dontSeeCurrentUrlEquals('/'); 496 | * ?> 497 | * ``` 498 | * 499 | * @param $uri 500 | * Conditional Assertion: Test won't be stopped on fail 501 | * @see \Codeception\Lib\InnerBrowser::dontSeeCurrentUrlEquals() 502 | */ 503 | public function cantSeeCurrentUrlEquals($uri) { 504 | return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCurrentUrlEquals', func_get_args())); 505 | } 506 | /** 507 | * [!] Method is generated. Documentation taken from corresponding module. 508 | * 509 | * Checks that current url is not equal to value. 510 | * Unlike `dontSeeInCurrentUrl` performs a strict check. 511 | * 512 | * ``` php 513 | * dontSeeCurrentUrlEquals('/'); 516 | * ?> 517 | * ``` 518 | * 519 | * @param $uri 520 | * @see \Codeception\Lib\InnerBrowser::dontSeeCurrentUrlEquals() 521 | */ 522 | public function dontSeeCurrentUrlEquals($uri) { 523 | return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeCurrentUrlEquals', func_get_args())); 524 | } 525 | 526 | 527 | /** 528 | * [!] Method is generated. Documentation taken from corresponding module. 529 | * 530 | * Checks that current url is matches a RegEx value 531 | * 532 | * ``` php 533 | * seeCurrentUrlMatches('~$/users/(\d+)~'); 536 | * ?> 537 | * ``` 538 | * 539 | * @param $uri 540 | * Conditional Assertion: Test won't be stopped on fail 541 | * @see \Codeception\Lib\InnerBrowser::seeCurrentUrlMatches() 542 | */ 543 | public function canSeeCurrentUrlMatches($uri) { 544 | return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeCurrentUrlMatches', func_get_args())); 545 | } 546 | /** 547 | * [!] Method is generated. Documentation taken from corresponding module. 548 | * 549 | * Checks that current url is matches a RegEx value 550 | * 551 | * ``` php 552 | * seeCurrentUrlMatches('~$/users/(\d+)~'); 555 | * ?> 556 | * ``` 557 | * 558 | * @param $uri 559 | * @see \Codeception\Lib\InnerBrowser::seeCurrentUrlMatches() 560 | */ 561 | public function seeCurrentUrlMatches($uri) { 562 | return $this->scenario->runStep(new \Codeception\Step\Assertion('seeCurrentUrlMatches', func_get_args())); 563 | } 564 | 565 | 566 | /** 567 | * [!] Method is generated. Documentation taken from corresponding module. 568 | * 569 | * Checks that current url does not match a RegEx value 570 | * 571 | * ``` php 572 | * dontSeeCurrentUrlMatches('~$/users/(\d+)~'); 575 | * ?> 576 | * ``` 577 | * 578 | * @param $uri 579 | * Conditional Assertion: Test won't be stopped on fail 580 | * @see \Codeception\Lib\InnerBrowser::dontSeeCurrentUrlMatches() 581 | */ 582 | public function cantSeeCurrentUrlMatches($uri) { 583 | return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCurrentUrlMatches', func_get_args())); 584 | } 585 | /** 586 | * [!] Method is generated. Documentation taken from corresponding module. 587 | * 588 | * Checks that current url does not match a RegEx value 589 | * 590 | * ``` php 591 | * dontSeeCurrentUrlMatches('~$/users/(\d+)~'); 594 | * ?> 595 | * ``` 596 | * 597 | * @param $uri 598 | * @see \Codeception\Lib\InnerBrowser::dontSeeCurrentUrlMatches() 599 | */ 600 | public function dontSeeCurrentUrlMatches($uri) { 601 | return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeCurrentUrlMatches', func_get_args())); 602 | } 603 | 604 | 605 | /** 606 | * [!] Method is generated. Documentation taken from corresponding module. 607 | * 608 | * Takes a parameters from current URI by RegEx. 609 | * If no url provided returns full URI. 610 | * 611 | * ``` php 612 | * grabFromCurrentUrl('~$/user/(\d+)/~'); 614 | * $uri = $I->grabFromCurrentUrl(); 615 | * ?> 616 | * ``` 617 | * 618 | * @param null $uri 619 | * 620 | * @internal param $url 621 | * @return mixed 622 | * @see \Codeception\Lib\InnerBrowser::grabFromCurrentUrl() 623 | */ 624 | public function grabFromCurrentUrl($uri = null) { 625 | return $this->scenario->runStep(new \Codeception\Step\Action('grabFromCurrentUrl', func_get_args())); 626 | } 627 | 628 | 629 | /** 630 | * [!] Method is generated. Documentation taken from corresponding module. 631 | * 632 | * Assert if the specified checkbox is checked. 633 | * Use css selector or xpath to match. 634 | * 635 | * Example: 636 | * 637 | * ``` php 638 | * seeCheckboxIsChecked('#agree'); // I suppose user agreed to terms 640 | * $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user agreed to terms, If there is only one checkbox in form. 641 | * $I->seeCheckboxIsChecked('//form/input[@type=checkbox and @name=agree]'); 642 | * ?> 643 | * ``` 644 | * 645 | * @param $checkbox 646 | * Conditional Assertion: Test won't be stopped on fail 647 | * @see \Codeception\Lib\InnerBrowser::seeCheckboxIsChecked() 648 | */ 649 | public function canSeeCheckboxIsChecked($checkbox) { 650 | return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeCheckboxIsChecked', func_get_args())); 651 | } 652 | /** 653 | * [!] Method is generated. Documentation taken from corresponding module. 654 | * 655 | * Assert if the specified checkbox is checked. 656 | * Use css selector or xpath to match. 657 | * 658 | * Example: 659 | * 660 | * ``` php 661 | * seeCheckboxIsChecked('#agree'); // I suppose user agreed to terms 663 | * $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user agreed to terms, If there is only one checkbox in form. 664 | * $I->seeCheckboxIsChecked('//form/input[@type=checkbox and @name=agree]'); 665 | * ?> 666 | * ``` 667 | * 668 | * @param $checkbox 669 | * @see \Codeception\Lib\InnerBrowser::seeCheckboxIsChecked() 670 | */ 671 | public function seeCheckboxIsChecked($checkbox) { 672 | return $this->scenario->runStep(new \Codeception\Step\Assertion('seeCheckboxIsChecked', func_get_args())); 673 | } 674 | 675 | 676 | /** 677 | * [!] Method is generated. Documentation taken from corresponding module. 678 | * 679 | * Assert if the specified checkbox is unchecked. 680 | * Use css selector or xpath to match. 681 | * 682 | * Example: 683 | * 684 | * ``` php 685 | * dontSeeCheckboxIsChecked('#agree'); // I suppose user didn't agree to terms 687 | * $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user didn't check the first checkbox in form. 688 | * ?> 689 | * ``` 690 | * 691 | * @param $checkbox 692 | * Conditional Assertion: Test won't be stopped on fail 693 | * @see \Codeception\Lib\InnerBrowser::dontSeeCheckboxIsChecked() 694 | */ 695 | public function cantSeeCheckboxIsChecked($checkbox) { 696 | return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCheckboxIsChecked', func_get_args())); 697 | } 698 | /** 699 | * [!] Method is generated. Documentation taken from corresponding module. 700 | * 701 | * Assert if the specified checkbox is unchecked. 702 | * Use css selector or xpath to match. 703 | * 704 | * Example: 705 | * 706 | * ``` php 707 | * dontSeeCheckboxIsChecked('#agree'); // I suppose user didn't agree to terms 709 | * $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user didn't check the first checkbox in form. 710 | * ?> 711 | * ``` 712 | * 713 | * @param $checkbox 714 | * @see \Codeception\Lib\InnerBrowser::dontSeeCheckboxIsChecked() 715 | */ 716 | public function dontSeeCheckboxIsChecked($checkbox) { 717 | return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeCheckboxIsChecked', func_get_args())); 718 | } 719 | 720 | 721 | /** 722 | * [!] Method is generated. Documentation taken from corresponding module. 723 | * 724 | * Checks that an input field or textarea contains value. 725 | * Field is matched either by label or CSS or Xpath 726 | * 727 | * Example: 728 | * 729 | * ``` php 730 | * seeInField('Body','Type your comment here'); 732 | * $I->seeInField('form textarea[name=body]','Type your comment here'); 733 | * $I->seeInField('form input[type=hidden]','hidden_value'); 734 | * $I->seeInField('#searchform input','Search'); 735 | * $I->seeInField('//form/*[@name=search]','Search'); 736 | * $I->seeInField(['name' => 'search'], 'Search'); 737 | * ?> 738 | * ``` 739 | * 740 | * @param $field 741 | * @param $value 742 | * Conditional Assertion: Test won't be stopped on fail 743 | * @see \Codeception\Lib\InnerBrowser::seeInField() 744 | */ 745 | public function canSeeInField($field, $value) { 746 | return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeInField', func_get_args())); 747 | } 748 | /** 749 | * [!] Method is generated. Documentation taken from corresponding module. 750 | * 751 | * Checks that an input field or textarea contains value. 752 | * Field is matched either by label or CSS or Xpath 753 | * 754 | * Example: 755 | * 756 | * ``` php 757 | * seeInField('Body','Type your comment here'); 759 | * $I->seeInField('form textarea[name=body]','Type your comment here'); 760 | * $I->seeInField('form input[type=hidden]','hidden_value'); 761 | * $I->seeInField('#searchform input','Search'); 762 | * $I->seeInField('//form/*[@name=search]','Search'); 763 | * $I->seeInField(['name' => 'search'], 'Search'); 764 | * ?> 765 | * ``` 766 | * 767 | * @param $field 768 | * @param $value 769 | * @see \Codeception\Lib\InnerBrowser::seeInField() 770 | */ 771 | public function seeInField($field, $value) { 772 | return $this->scenario->runStep(new \Codeception\Step\Assertion('seeInField', func_get_args())); 773 | } 774 | 775 | 776 | /** 777 | * [!] Method is generated. Documentation taken from corresponding module. 778 | * 779 | * Checks that an input field or textarea doesn't contain value. 780 | * Field is matched either by label or CSS or Xpath 781 | * Example: 782 | * 783 | * ``` php 784 | * dontSeeInField('Body','Type your comment here'); 786 | * $I->dontSeeInField('form textarea[name=body]','Type your comment here'); 787 | * $I->dontSeeInField('form input[type=hidden]','hidden_value'); 788 | * $I->dontSeeInField('#searchform input','Search'); 789 | * $I->dontSeeInField('//form/*[@name=search]','Search'); 790 | * $I->seeInField(['name' => 'search'], 'Search'); 791 | * ?> 792 | * ``` 793 | * 794 | * @param $field 795 | * @param $value 796 | * Conditional Assertion: Test won't be stopped on fail 797 | * @see \Codeception\Lib\InnerBrowser::dontSeeInField() 798 | */ 799 | public function cantSeeInField($field, $value) { 800 | return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInField', func_get_args())); 801 | } 802 | /** 803 | * [!] Method is generated. Documentation taken from corresponding module. 804 | * 805 | * Checks that an input field or textarea doesn't contain value. 806 | * Field is matched either by label or CSS or Xpath 807 | * Example: 808 | * 809 | * ``` php 810 | * dontSeeInField('Body','Type your comment here'); 812 | * $I->dontSeeInField('form textarea[name=body]','Type your comment here'); 813 | * $I->dontSeeInField('form input[type=hidden]','hidden_value'); 814 | * $I->dontSeeInField('#searchform input','Search'); 815 | * $I->dontSeeInField('//form/*[@name=search]','Search'); 816 | * $I->seeInField(['name' => 'search'], 'Search'); 817 | * ?> 818 | * ``` 819 | * 820 | * @param $field 821 | * @param $value 822 | * @see \Codeception\Lib\InnerBrowser::dontSeeInField() 823 | */ 824 | public function dontSeeInField($field, $value) { 825 | return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeInField', func_get_args())); 826 | } 827 | 828 | 829 | /** 830 | * [!] Method is generated. Documentation taken from corresponding module. 831 | * 832 | * Submits a form located on page. 833 | * Specify the form by it's css or xpath selector. 834 | * Fill the form fields values as array. 835 | * 836 | * Skipped fields will be filled by their values from page. 837 | * You don't need to click the 'Submit' button afterwards. 838 | * This command itself triggers the request to form's action. 839 | * 840 | * Examples: 841 | * 842 | * ``` php 843 | * submitForm('#login', array('login' => 'davert', 'password' => '123456')); 845 | * 846 | * ``` 847 | * 848 | * For sample Sign Up form: 849 | * 850 | * ``` html 851 | *
852 | * Login:
853 | * Password:
854 | * Do you agree to out terms?
855 | * Select pricing plan 856 | * 857 | *
858 | * ``` 859 | * I can write this: 860 | * 861 | * ``` php 862 | * submitForm('#userForm', array('user' => array('login' => 'Davert', 'password' => '123456', 'agree' => true))); 864 | * 865 | * ``` 866 | * Note, that pricing plan will be set to Paid, as it's selected on page. 867 | * 868 | * @param $selector 869 | * @param $params 870 | * @see \Codeception\Lib\InnerBrowser::submitForm() 871 | */ 872 | public function submitForm($selector, $params) { 873 | return $this->scenario->runStep(new \Codeception\Step\Action('submitForm', func_get_args())); 874 | } 875 | 876 | 877 | /** 878 | * [!] Method is generated. Documentation taken from corresponding module. 879 | * 880 | * Fills a text field or textarea with value. 881 | * 882 | * Example: 883 | * 884 | * ``` php 885 | * fillField("//input[@type='text']", "Hello World!"); 887 | * $I->fillField(['name' => 'email'], 'jon@mail.com'); 888 | * ?> 889 | * ``` 890 | * 891 | * @param $field 892 | * @param $value 893 | * @see \Codeception\Lib\InnerBrowser::fillField() 894 | */ 895 | public function fillField($field, $value) { 896 | return $this->scenario->runStep(new \Codeception\Step\Action('fillField', func_get_args())); 897 | } 898 | 899 | 900 | /** 901 | * [!] Method is generated. Documentation taken from corresponding module. 902 | * 903 | * Selects an option in select tag or in radio button group. 904 | * 905 | * Example: 906 | * 907 | * ``` php 908 | * selectOption('form select[name=account]', 'Premium'); 910 | * $I->selectOption('form input[name=payment]', 'Monthly'); 911 | * $I->selectOption('//form/select[@name=account]', 'Monthly'); 912 | * ?> 913 | * ``` 914 | * 915 | * Can select multiple options if second argument is array: 916 | * 917 | * ``` php 918 | * selectOption('Which OS do you use?', array('Windows','Linux')); 920 | * ?> 921 | * ``` 922 | * 923 | * @param $select 924 | * @param $option 925 | * @see \Codeception\Lib\InnerBrowser::selectOption() 926 | */ 927 | public function selectOption($select, $option) { 928 | return $this->scenario->runStep(new \Codeception\Step\Action('selectOption', func_get_args())); 929 | } 930 | 931 | 932 | /** 933 | * [!] Method is generated. Documentation taken from corresponding module. 934 | * 935 | * Ticks a checkbox. 936 | * For radio buttons use `selectOption` method. 937 | * 938 | * Example: 939 | * 940 | * ``` php 941 | * checkOption('#agree'); 943 | * ?> 944 | * ``` 945 | * 946 | * @param $option 947 | * @see \Codeception\Lib\InnerBrowser::checkOption() 948 | */ 949 | public function checkOption($option) { 950 | return $this->scenario->runStep(new \Codeception\Step\Action('checkOption', func_get_args())); 951 | } 952 | 953 | 954 | /** 955 | * [!] Method is generated. Documentation taken from corresponding module. 956 | * 957 | * Unticks a checkbox. 958 | * 959 | * Example: 960 | * 961 | * ``` php 962 | * uncheckOption('#notify'); 964 | * ?> 965 | * ``` 966 | * 967 | * @param $option 968 | * @see \Codeception\Lib\InnerBrowser::uncheckOption() 969 | */ 970 | public function uncheckOption($option) { 971 | return $this->scenario->runStep(new \Codeception\Step\Action('uncheckOption', func_get_args())); 972 | } 973 | 974 | 975 | /** 976 | * [!] Method is generated. Documentation taken from corresponding module. 977 | * 978 | * Attaches file from Codeception data directory to upload field. 979 | * 980 | * Example: 981 | * 982 | * ``` php 983 | * attachFile('input[@type="file"]', 'prices.xls'); 986 | * ?> 987 | * ``` 988 | * 989 | * @param $field 990 | * @param $filename 991 | * @see \Codeception\Lib\InnerBrowser::attachFile() 992 | */ 993 | public function attachFile($field, $filename) { 994 | return $this->scenario->runStep(new \Codeception\Step\Action('attachFile', func_get_args())); 995 | } 996 | 997 | 998 | /** 999 | * [!] Method is generated. Documentation taken from corresponding module. 1000 | * 1001 | * If your page triggers an ajax request, you can perform it manually. 1002 | * This action sends a GET ajax request with specified params. 1003 | * 1004 | * See ->sendAjaxPostRequest for examples. 1005 | * 1006 | * @param $uri 1007 | * @param $params 1008 | * @see \Codeception\Lib\InnerBrowser::sendAjaxGetRequest() 1009 | */ 1010 | public function sendAjaxGetRequest($uri, $params = null) { 1011 | return $this->scenario->runStep(new \Codeception\Step\Action('sendAjaxGetRequest', func_get_args())); 1012 | } 1013 | 1014 | 1015 | /** 1016 | * [!] Method is generated. Documentation taken from corresponding module. 1017 | * 1018 | * If your page triggers an ajax request, you can perform it manually. 1019 | * This action sends a POST ajax request with specified params. 1020 | * Additional params can be passed as array. 1021 | * 1022 | * Example: 1023 | * 1024 | * Imagine that by clicking checkbox you trigger ajax request which updates user settings. 1025 | * We emulate that click by running this ajax request manually. 1026 | * 1027 | * ``` php 1028 | * sendAjaxPostRequest('/updateSettings', array('notifications' => true)); // POST 1030 | * $I->sendAjaxGetRequest('/updateSettings', array('notifications' => true)); // GET 1031 | * 1032 | * ``` 1033 | * 1034 | * @param $uri 1035 | * @param $params 1036 | * @see \Codeception\Lib\InnerBrowser::sendAjaxPostRequest() 1037 | */ 1038 | public function sendAjaxPostRequest($uri, $params = null) { 1039 | return $this->scenario->runStep(new \Codeception\Step\Action('sendAjaxPostRequest', func_get_args())); 1040 | } 1041 | 1042 | 1043 | /** 1044 | * [!] Method is generated. Documentation taken from corresponding module. 1045 | * 1046 | * If your page triggers an ajax request, you can perform it manually. 1047 | * This action sends an ajax request with specified method and params. 1048 | * 1049 | * Example: 1050 | * 1051 | * You need to perform an ajax request specifying the HTTP method. 1052 | * 1053 | * ``` php 1054 | * sendAjaxRequest('PUT', /posts/7', array('title' => 'new title'); 1056 | * 1057 | * ``` 1058 | * 1059 | * @param $method 1060 | * @param $uri 1061 | * @param $params 1062 | * @see \Codeception\Lib\InnerBrowser::sendAjaxRequest() 1063 | */ 1064 | public function sendAjaxRequest($method, $uri, $params = null) { 1065 | return $this->scenario->runStep(new \Codeception\Step\Action('sendAjaxRequest', func_get_args())); 1066 | } 1067 | 1068 | 1069 | /** 1070 | * [!] Method is generated. Documentation taken from corresponding module. 1071 | * 1072 | * Finds and returns text contents of element. 1073 | * Element is searched by CSS selector, XPath or matcher by regex. 1074 | * 1075 | * Example: 1076 | * 1077 | * ``` php 1078 | * grabTextFrom('h1'); 1080 | * $heading = $I->grabTextFrom('descendant-or-self::h1'); 1081 | * $value = $I->grabTextFrom('~ 1083 | * ``` 1084 | * 1085 | * @param $cssOrXPathOrRegex 1086 | * 1087 | * @return mixed 1088 | * @see \Codeception\Lib\InnerBrowser::grabTextFrom() 1089 | */ 1090 | public function grabTextFrom($cssOrXPathOrRegex) { 1091 | return $this->scenario->runStep(new \Codeception\Step\Action('grabTextFrom', func_get_args())); 1092 | } 1093 | 1094 | 1095 | /** 1096 | * [!] Method is generated. Documentation taken from corresponding module. 1097 | * 1098 | * Grabs attribute value from an element. 1099 | * Fails if element is not found. 1100 | * 1101 | * ``` php 1102 | * grabAttributeFrom('#tooltip', 'title'); 1104 | * ?> 1105 | * ``` 1106 | * 1107 | * 1108 | * @param $cssOrXpath 1109 | * @param $attribute 1110 | * @internal param $element 1111 | * @return mixed 1112 | * @see \Codeception\Lib\InnerBrowser::grabAttributeFrom() 1113 | */ 1114 | public function grabAttributeFrom($cssOrXpath, $attribute) { 1115 | return $this->scenario->runStep(new \Codeception\Step\Action('grabAttributeFrom', func_get_args())); 1116 | } 1117 | 1118 | 1119 | /** 1120 | * [!] Method is generated. Documentation taken from corresponding module. 1121 | * 1122 | * @param $field 1123 | * 1124 | * @return array|mixed|null|string 1125 | * @see \Codeception\Lib\InnerBrowser::grabValueFrom() 1126 | */ 1127 | public function grabValueFrom($field) { 1128 | return $this->scenario->runStep(new \Codeception\Step\Action('grabValueFrom', func_get_args())); 1129 | } 1130 | 1131 | 1132 | /** 1133 | * [!] Method is generated. Documentation taken from corresponding module. 1134 | * 1135 | * Sets a cookie. 1136 | * 1137 | * @param $cookie 1138 | * @param $value 1139 | * 1140 | * @return mixed 1141 | * @see \Codeception\Lib\InnerBrowser::setCookie() 1142 | */ 1143 | public function setCookie($name, $val) { 1144 | return $this->scenario->runStep(new \Codeception\Step\Action('setCookie', func_get_args())); 1145 | } 1146 | 1147 | 1148 | /** 1149 | * [!] Method is generated. Documentation taken from corresponding module. 1150 | * 1151 | * Grabs a cookie value. 1152 | * 1153 | * @param $cookie 1154 | * 1155 | * @return mixed 1156 | * @see \Codeception\Lib\InnerBrowser::grabCookie() 1157 | */ 1158 | public function grabCookie($name) { 1159 | return $this->scenario->runStep(new \Codeception\Step\Action('grabCookie', func_get_args())); 1160 | } 1161 | 1162 | 1163 | /** 1164 | * [!] Method is generated. Documentation taken from corresponding module. 1165 | * 1166 | * Checks that cookie is set. 1167 | * 1168 | * @param $cookie 1169 | * 1170 | * @return mixed 1171 | * Conditional Assertion: Test won't be stopped on fail 1172 | * @see \Codeception\Lib\InnerBrowser::seeCookie() 1173 | */ 1174 | public function canSeeCookie($name) { 1175 | return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeCookie', func_get_args())); 1176 | } 1177 | /** 1178 | * [!] Method is generated. Documentation taken from corresponding module. 1179 | * 1180 | * Checks that cookie is set. 1181 | * 1182 | * @param $cookie 1183 | * 1184 | * @return mixed 1185 | * @see \Codeception\Lib\InnerBrowser::seeCookie() 1186 | */ 1187 | public function seeCookie($name) { 1188 | return $this->scenario->runStep(new \Codeception\Step\Assertion('seeCookie', func_get_args())); 1189 | } 1190 | 1191 | 1192 | /** 1193 | * [!] Method is generated. Documentation taken from corresponding module. 1194 | * 1195 | * Checks that cookie doesn't exist 1196 | * 1197 | * @param $cookie 1198 | * 1199 | * @return mixed 1200 | * Conditional Assertion: Test won't be stopped on fail 1201 | * @see \Codeception\Lib\InnerBrowser::dontSeeCookie() 1202 | */ 1203 | public function cantSeeCookie($name) { 1204 | return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCookie', func_get_args())); 1205 | } 1206 | /** 1207 | * [!] Method is generated. Documentation taken from corresponding module. 1208 | * 1209 | * Checks that cookie doesn't exist 1210 | * 1211 | * @param $cookie 1212 | * 1213 | * @return mixed 1214 | * @see \Codeception\Lib\InnerBrowser::dontSeeCookie() 1215 | */ 1216 | public function dontSeeCookie($name) { 1217 | return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeCookie', func_get_args())); 1218 | } 1219 | 1220 | 1221 | /** 1222 | * [!] Method is generated. Documentation taken from corresponding module. 1223 | * 1224 | * Unsets cookie 1225 | * 1226 | * @param $cookie 1227 | * 1228 | * @return mixed 1229 | * @see \Codeception\Lib\InnerBrowser::resetCookie() 1230 | */ 1231 | public function resetCookie($name) { 1232 | return $this->scenario->runStep(new \Codeception\Step\Action('resetCookie', func_get_args())); 1233 | } 1234 | 1235 | 1236 | /** 1237 | * [!] Method is generated. Documentation taken from corresponding module. 1238 | * 1239 | * Checks if element exists on a page, matching it by CSS or XPath. 1240 | * You can also specify expected attributes of this element. 1241 | * 1242 | * ``` php 1243 | * seeElement('.error'); 1245 | * $I->seeElement('//form/input[1]'); 1246 | * $I->seeElement('input', ['name' => 'login']); 1247 | * $I->seeElement('input', ['value' => '123456']); 1248 | * 1249 | * // strict locator in first arg, attributes in second 1250 | * $I->seeElement(['css' => 'form input'], ['name' => 'login']); 1251 | * ?> 1252 | * ``` 1253 | * 1254 | * @param $selector 1255 | * @param array $attributes 1256 | * @return 1257 | * Conditional Assertion: Test won't be stopped on fail 1258 | * @see \Codeception\Lib\InnerBrowser::seeElement() 1259 | */ 1260 | public function canSeeElement($selector, $attributes = null) { 1261 | return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeElement', func_get_args())); 1262 | } 1263 | /** 1264 | * [!] Method is generated. Documentation taken from corresponding module. 1265 | * 1266 | * Checks if element exists on a page, matching it by CSS or XPath. 1267 | * You can also specify expected attributes of this element. 1268 | * 1269 | * ``` php 1270 | * seeElement('.error'); 1272 | * $I->seeElement('//form/input[1]'); 1273 | * $I->seeElement('input', ['name' => 'login']); 1274 | * $I->seeElement('input', ['value' => '123456']); 1275 | * 1276 | * // strict locator in first arg, attributes in second 1277 | * $I->seeElement(['css' => 'form input'], ['name' => 'login']); 1278 | * ?> 1279 | * ``` 1280 | * 1281 | * @param $selector 1282 | * @param array $attributes 1283 | * @return 1284 | * @see \Codeception\Lib\InnerBrowser::seeElement() 1285 | */ 1286 | public function seeElement($selector, $attributes = null) { 1287 | return $this->scenario->runStep(new \Codeception\Step\Assertion('seeElement', func_get_args())); 1288 | } 1289 | 1290 | 1291 | /** 1292 | * [!] Method is generated. Documentation taken from corresponding module. 1293 | * 1294 | * Checks if element does not exist (or is visible) on a page, matching it by CSS or XPath 1295 | * You can also specify expected attributes of this element. 1296 | * 1297 | * Example: 1298 | * 1299 | * ``` php 1300 | * dontSeeElement('.error'); 1302 | * $I->dontSeeElement('//form/input[1]'); 1303 | * $I->dontSeeElement('input', ['name' => 'login']); 1304 | * $I->dontSeeElement('input', ['value' => '123456']); 1305 | * ?> 1306 | * ``` 1307 | * 1308 | * @param $selector 1309 | * Conditional Assertion: Test won't be stopped on fail 1310 | * @see \Codeception\Lib\InnerBrowser::dontSeeElement() 1311 | */ 1312 | public function cantSeeElement($selector, $attributes = null) { 1313 | return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeElement', func_get_args())); 1314 | } 1315 | /** 1316 | * [!] Method is generated. Documentation taken from corresponding module. 1317 | * 1318 | * Checks if element does not exist (or is visible) on a page, matching it by CSS or XPath 1319 | * You can also specify expected attributes of this element. 1320 | * 1321 | * Example: 1322 | * 1323 | * ``` php 1324 | * dontSeeElement('.error'); 1326 | * $I->dontSeeElement('//form/input[1]'); 1327 | * $I->dontSeeElement('input', ['name' => 'login']); 1328 | * $I->dontSeeElement('input', ['value' => '123456']); 1329 | * ?> 1330 | * ``` 1331 | * 1332 | * @param $selector 1333 | * @see \Codeception\Lib\InnerBrowser::dontSeeElement() 1334 | */ 1335 | public function dontSeeElement($selector, $attributes = null) { 1336 | return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeElement', func_get_args())); 1337 | } 1338 | 1339 | 1340 | /** 1341 | * [!] Method is generated. Documentation taken from corresponding module. 1342 | * 1343 | * Checks if option is selected in select field. 1344 | * 1345 | * ``` php 1346 | * seeOptionIsSelected('#form input[name=payment]', 'Visa'); 1348 | * ?> 1349 | * ``` 1350 | * 1351 | * @param $selector 1352 | * @param $optionText 1353 | * 1354 | * @return mixed 1355 | * Conditional Assertion: Test won't be stopped on fail 1356 | * @see \Codeception\Lib\InnerBrowser::seeOptionIsSelected() 1357 | */ 1358 | public function canSeeOptionIsSelected($select, $optionText) { 1359 | return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeOptionIsSelected', func_get_args())); 1360 | } 1361 | /** 1362 | * [!] Method is generated. Documentation taken from corresponding module. 1363 | * 1364 | * Checks if option is selected in select field. 1365 | * 1366 | * ``` php 1367 | * seeOptionIsSelected('#form input[name=payment]', 'Visa'); 1369 | * ?> 1370 | * ``` 1371 | * 1372 | * @param $selector 1373 | * @param $optionText 1374 | * 1375 | * @return mixed 1376 | * @see \Codeception\Lib\InnerBrowser::seeOptionIsSelected() 1377 | */ 1378 | public function seeOptionIsSelected($select, $optionText) { 1379 | return $this->scenario->runStep(new \Codeception\Step\Assertion('seeOptionIsSelected', func_get_args())); 1380 | } 1381 | 1382 | 1383 | /** 1384 | * [!] Method is generated. Documentation taken from corresponding module. 1385 | * 1386 | * Checks if option is not selected in select field. 1387 | * 1388 | * ``` php 1389 | * dontSeeOptionIsSelected('#form input[name=payment]', 'Visa'); 1391 | * ?> 1392 | * ``` 1393 | * 1394 | * @param $selector 1395 | * @param $optionText 1396 | * 1397 | * @return mixed 1398 | * Conditional Assertion: Test won't be stopped on fail 1399 | * @see \Codeception\Lib\InnerBrowser::dontSeeOptionIsSelected() 1400 | */ 1401 | public function cantSeeOptionIsSelected($select, $optionText) { 1402 | return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeOptionIsSelected', func_get_args())); 1403 | } 1404 | /** 1405 | * [!] Method is generated. Documentation taken from corresponding module. 1406 | * 1407 | * Checks if option is not selected in select field. 1408 | * 1409 | * ``` php 1410 | * dontSeeOptionIsSelected('#form input[name=payment]', 'Visa'); 1412 | * ?> 1413 | * ``` 1414 | * 1415 | * @param $selector 1416 | * @param $optionText 1417 | * 1418 | * @return mixed 1419 | * @see \Codeception\Lib\InnerBrowser::dontSeeOptionIsSelected() 1420 | */ 1421 | public function dontSeeOptionIsSelected($select, $optionText) { 1422 | return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeOptionIsSelected', func_get_args())); 1423 | } 1424 | 1425 | 1426 | /** 1427 | * [!] Method is generated. Documentation taken from corresponding module. 1428 | * 1429 | * Asserts that current page has 404 response status code. 1430 | * Conditional Assertion: Test won't be stopped on fail 1431 | * @see \Codeception\Lib\InnerBrowser::seePageNotFound() 1432 | */ 1433 | public function canSeePageNotFound() { 1434 | return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seePageNotFound', func_get_args())); 1435 | } 1436 | /** 1437 | * [!] Method is generated. Documentation taken from corresponding module. 1438 | * 1439 | * Asserts that current page has 404 response status code. 1440 | * @see \Codeception\Lib\InnerBrowser::seePageNotFound() 1441 | */ 1442 | public function seePageNotFound() { 1443 | return $this->scenario->runStep(new \Codeception\Step\Assertion('seePageNotFound', func_get_args())); 1444 | } 1445 | 1446 | 1447 | /** 1448 | * [!] Method is generated. Documentation taken from corresponding module. 1449 | * 1450 | * Checks that response code is equal to value provided. 1451 | * 1452 | * @param $code 1453 | * 1454 | * @return mixed 1455 | * Conditional Assertion: Test won't be stopped on fail 1456 | * @see \Codeception\Lib\InnerBrowser::seeResponseCodeIs() 1457 | */ 1458 | public function canSeeResponseCodeIs($code) { 1459 | return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeResponseCodeIs', func_get_args())); 1460 | } 1461 | /** 1462 | * [!] Method is generated. Documentation taken from corresponding module. 1463 | * 1464 | * Checks that response code is equal to value provided. 1465 | * 1466 | * @param $code 1467 | * 1468 | * @return mixed 1469 | * @see \Codeception\Lib\InnerBrowser::seeResponseCodeIs() 1470 | */ 1471 | public function seeResponseCodeIs($code) { 1472 | return $this->scenario->runStep(new \Codeception\Step\Assertion('seeResponseCodeIs', func_get_args())); 1473 | } 1474 | 1475 | 1476 | /** 1477 | * [!] Method is generated. Documentation taken from corresponding module. 1478 | * 1479 | * Checks that page title contains text. 1480 | * 1481 | * ``` php 1482 | * seeInTitle('Blog - Post #1'); 1484 | * ?> 1485 | * ``` 1486 | * 1487 | * @param $title 1488 | * 1489 | * @return mixed 1490 | * Conditional Assertion: Test won't be stopped on fail 1491 | * @see \Codeception\Lib\InnerBrowser::seeInTitle() 1492 | */ 1493 | public function canSeeInTitle($title) { 1494 | return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeInTitle', func_get_args())); 1495 | } 1496 | /** 1497 | * [!] Method is generated. Documentation taken from corresponding module. 1498 | * 1499 | * Checks that page title contains text. 1500 | * 1501 | * ``` php 1502 | * seeInTitle('Blog - Post #1'); 1504 | * ?> 1505 | * ``` 1506 | * 1507 | * @param $title 1508 | * 1509 | * @return mixed 1510 | * @see \Codeception\Lib\InnerBrowser::seeInTitle() 1511 | */ 1512 | public function seeInTitle($title) { 1513 | return $this->scenario->runStep(new \Codeception\Step\Assertion('seeInTitle', func_get_args())); 1514 | } 1515 | 1516 | 1517 | /** 1518 | * [!] Method is generated. Documentation taken from corresponding module. 1519 | * 1520 | * Checks that page title does not contain text. 1521 | * 1522 | * @param $title 1523 | * 1524 | * @return mixed 1525 | * Conditional Assertion: Test won't be stopped on fail 1526 | * @see \Codeception\Lib\InnerBrowser::dontSeeInTitle() 1527 | */ 1528 | public function cantSeeInTitle($title) { 1529 | return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInTitle', func_get_args())); 1530 | } 1531 | /** 1532 | * [!] Method is generated. Documentation taken from corresponding module. 1533 | * 1534 | * Checks that page title does not contain text. 1535 | * 1536 | * @param $title 1537 | * 1538 | * @return mixed 1539 | * @see \Codeception\Lib\InnerBrowser::dontSeeInTitle() 1540 | */ 1541 | public function dontSeeInTitle($title) { 1542 | return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeInTitle', func_get_args())); 1543 | } 1544 | 1545 | 1546 | /** 1547 | * [!] Method is generated. Documentation taken from corresponding module. 1548 | * 1549 | * Executes a shell command 1550 | * 1551 | * @param $command 1552 | * @see \Codeception\Module\Cli::runShellCommand() 1553 | */ 1554 | public function runShellCommand($command) { 1555 | return $this->scenario->runStep(new \Codeception\Step\Action('runShellCommand', func_get_args())); 1556 | } 1557 | 1558 | 1559 | /** 1560 | * [!] Method is generated. Documentation taken from corresponding module. 1561 | * 1562 | * Checks that output from last executed command contains text 1563 | * 1564 | * @param $text 1565 | * Conditional Assertion: Test won't be stopped on fail 1566 | * @see \Codeception\Module\Cli::seeInShellOutput() 1567 | */ 1568 | public function canSeeInShellOutput($text) { 1569 | return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeInShellOutput', func_get_args())); 1570 | } 1571 | /** 1572 | * [!] Method is generated. Documentation taken from corresponding module. 1573 | * 1574 | * Checks that output from last executed command contains text 1575 | * 1576 | * @param $text 1577 | * @see \Codeception\Module\Cli::seeInShellOutput() 1578 | */ 1579 | public function seeInShellOutput($text) { 1580 | return $this->scenario->runStep(new \Codeception\Step\Assertion('seeInShellOutput', func_get_args())); 1581 | } 1582 | 1583 | 1584 | /** 1585 | * [!] Method is generated. Documentation taken from corresponding module. 1586 | * 1587 | * Checks that output from latest command doesn't contain text 1588 | * 1589 | * @param $text 1590 | * 1591 | * Conditional Assertion: Test won't be stopped on fail 1592 | * @see \Codeception\Module\Cli::dontSeeInShellOutput() 1593 | */ 1594 | public function cantSeeInShellOutput($text) { 1595 | return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInShellOutput', func_get_args())); 1596 | } 1597 | /** 1598 | * [!] Method is generated. Documentation taken from corresponding module. 1599 | * 1600 | * Checks that output from latest command doesn't contain text 1601 | * 1602 | * @param $text 1603 | * 1604 | * @see \Codeception\Module\Cli::dontSeeInShellOutput() 1605 | */ 1606 | public function dontSeeInShellOutput($text) { 1607 | return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeInShellOutput', func_get_args())); 1608 | } 1609 | 1610 | 1611 | /** 1612 | * [!] Method is generated. Documentation taken from corresponding module. 1613 | * 1614 | * 1615 | * Conditional Assertion: Test won't be stopped on fail 1616 | * @see \Codeception\Module\Cli::seeShellOutputMatches() 1617 | */ 1618 | public function canSeeShellOutputMatches($regex) { 1619 | return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeShellOutputMatches', func_get_args())); 1620 | } 1621 | /** 1622 | * [!] Method is generated. Documentation taken from corresponding module. 1623 | * 1624 | * 1625 | * @see \Codeception\Module\Cli::seeShellOutputMatches() 1626 | */ 1627 | public function seeShellOutputMatches($regex) { 1628 | return $this->scenario->runStep(new \Codeception\Step\Assertion('seeShellOutputMatches', func_get_args())); 1629 | } 1630 | 1631 | 1632 | /** 1633 | * [!] Method is generated. Documentation taken from corresponding module. 1634 | * 1635 | * Enters a directory In local filesystem. 1636 | * Project root directory is used by default 1637 | * 1638 | * @param $path 1639 | * @see \Codeception\Module\Filesystem::amInPath() 1640 | */ 1641 | public function amInPath($path) { 1642 | return $this->scenario->runStep(new \Codeception\Step\Condition('amInPath', func_get_args())); 1643 | } 1644 | 1645 | 1646 | /** 1647 | * [!] Method is generated. Documentation taken from corresponding module. 1648 | * 1649 | * Opens a file and stores it's content. 1650 | * 1651 | * Usage: 1652 | * 1653 | * ``` php 1654 | * openFile('composer.json'); 1656 | * $I->seeInThisFile('codeception/codeception'); 1657 | * ?> 1658 | * ``` 1659 | * 1660 | * @param $filename 1661 | * @see \Codeception\Module\Filesystem::openFile() 1662 | */ 1663 | public function openFile($filename) { 1664 | return $this->scenario->runStep(new \Codeception\Step\Action('openFile', func_get_args())); 1665 | } 1666 | 1667 | 1668 | /** 1669 | * [!] Method is generated. Documentation taken from corresponding module. 1670 | * 1671 | * Deletes a file 1672 | * 1673 | * ``` php 1674 | * deleteFile('composer.lock'); 1676 | * ?> 1677 | * ``` 1678 | * 1679 | * @param $filename 1680 | * @see \Codeception\Module\Filesystem::deleteFile() 1681 | */ 1682 | public function deleteFile($filename) { 1683 | return $this->scenario->runStep(new \Codeception\Step\Action('deleteFile', func_get_args())); 1684 | } 1685 | 1686 | 1687 | /** 1688 | * [!] Method is generated. Documentation taken from corresponding module. 1689 | * 1690 | * Deletes directory with all subdirectories 1691 | * 1692 | * ``` php 1693 | * deleteDir('vendor'); 1695 | * ?> 1696 | * ``` 1697 | * 1698 | * @param $dirname 1699 | * @see \Codeception\Module\Filesystem::deleteDir() 1700 | */ 1701 | public function deleteDir($dirname) { 1702 | return $this->scenario->runStep(new \Codeception\Step\Action('deleteDir', func_get_args())); 1703 | } 1704 | 1705 | 1706 | /** 1707 | * [!] Method is generated. Documentation taken from corresponding module. 1708 | * 1709 | * Copies directory with all contents 1710 | * 1711 | * ``` php 1712 | * copyDir('vendor','old_vendor'); 1714 | * ?> 1715 | * ``` 1716 | * 1717 | * @param $src 1718 | * @param $dst 1719 | * @see \Codeception\Module\Filesystem::copyDir() 1720 | */ 1721 | public function copyDir($src, $dst) { 1722 | return $this->scenario->runStep(new \Codeception\Step\Action('copyDir', func_get_args())); 1723 | } 1724 | 1725 | 1726 | /** 1727 | * [!] Method is generated. Documentation taken from corresponding module. 1728 | * 1729 | * Checks If opened file has `text` in it. 1730 | * 1731 | * Usage: 1732 | * 1733 | * ``` php 1734 | * openFile('composer.json'); 1736 | * $I->seeInThisFile('codeception/codeception'); 1737 | * ?> 1738 | * ``` 1739 | * 1740 | * @param $text 1741 | * Conditional Assertion: Test won't be stopped on fail 1742 | * @see \Codeception\Module\Filesystem::seeInThisFile() 1743 | */ 1744 | public function canSeeInThisFile($text) { 1745 | return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeInThisFile', func_get_args())); 1746 | } 1747 | /** 1748 | * [!] Method is generated. Documentation taken from corresponding module. 1749 | * 1750 | * Checks If opened file has `text` in it. 1751 | * 1752 | * Usage: 1753 | * 1754 | * ``` php 1755 | * openFile('composer.json'); 1757 | * $I->seeInThisFile('codeception/codeception'); 1758 | * ?> 1759 | * ``` 1760 | * 1761 | * @param $text 1762 | * @see \Codeception\Module\Filesystem::seeInThisFile() 1763 | */ 1764 | public function seeInThisFile($text) { 1765 | return $this->scenario->runStep(new \Codeception\Step\Assertion('seeInThisFile', func_get_args())); 1766 | } 1767 | 1768 | 1769 | /** 1770 | * [!] Method is generated. Documentation taken from corresponding module. 1771 | * 1772 | * Checks the strict matching of file contents. 1773 | * Unlike `seeInThisFile` will fail if file has something more then expected lines. 1774 | * Better to use with HEREDOC strings. 1775 | * Matching is done after removing "\r" chars from file content. 1776 | * 1777 | * ``` php 1778 | * openFile('process.pid'); 1780 | * $I->seeFileContentsEqual('3192'); 1781 | * ?> 1782 | * ``` 1783 | * 1784 | * @param $text 1785 | * Conditional Assertion: Test won't be stopped on fail 1786 | * @see \Codeception\Module\Filesystem::seeFileContentsEqual() 1787 | */ 1788 | public function canSeeFileContentsEqual($text) { 1789 | return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeFileContentsEqual', func_get_args())); 1790 | } 1791 | /** 1792 | * [!] Method is generated. Documentation taken from corresponding module. 1793 | * 1794 | * Checks the strict matching of file contents. 1795 | * Unlike `seeInThisFile` will fail if file has something more then expected lines. 1796 | * Better to use with HEREDOC strings. 1797 | * Matching is done after removing "\r" chars from file content. 1798 | * 1799 | * ``` php 1800 | * openFile('process.pid'); 1802 | * $I->seeFileContentsEqual('3192'); 1803 | * ?> 1804 | * ``` 1805 | * 1806 | * @param $text 1807 | * @see \Codeception\Module\Filesystem::seeFileContentsEqual() 1808 | */ 1809 | public function seeFileContentsEqual($text) { 1810 | return $this->scenario->runStep(new \Codeception\Step\Assertion('seeFileContentsEqual', func_get_args())); 1811 | } 1812 | 1813 | 1814 | /** 1815 | * [!] Method is generated. Documentation taken from corresponding module. 1816 | * 1817 | * Checks If opened file doesn't contain `text` in it 1818 | * 1819 | * ``` php 1820 | * openFile('composer.json'); 1822 | * $I->dontSeeInThisFile('codeception/codeception'); 1823 | * ?> 1824 | * ``` 1825 | * 1826 | * @param $text 1827 | * Conditional Assertion: Test won't be stopped on fail 1828 | * @see \Codeception\Module\Filesystem::dontSeeInThisFile() 1829 | */ 1830 | public function cantSeeInThisFile($text) { 1831 | return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInThisFile', func_get_args())); 1832 | } 1833 | /** 1834 | * [!] Method is generated. Documentation taken from corresponding module. 1835 | * 1836 | * Checks If opened file doesn't contain `text` in it 1837 | * 1838 | * ``` php 1839 | * openFile('composer.json'); 1841 | * $I->dontSeeInThisFile('codeception/codeception'); 1842 | * ?> 1843 | * ``` 1844 | * 1845 | * @param $text 1846 | * @see \Codeception\Module\Filesystem::dontSeeInThisFile() 1847 | */ 1848 | public function dontSeeInThisFile($text) { 1849 | return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeInThisFile', func_get_args())); 1850 | } 1851 | 1852 | 1853 | /** 1854 | * [!] Method is generated. Documentation taken from corresponding module. 1855 | * 1856 | * Deletes a file 1857 | * @see \Codeception\Module\Filesystem::deleteThisFile() 1858 | */ 1859 | public function deleteThisFile() { 1860 | return $this->scenario->runStep(new \Codeception\Step\Action('deleteThisFile', func_get_args())); 1861 | } 1862 | 1863 | 1864 | /** 1865 | * [!] Method is generated. Documentation taken from corresponding module. 1866 | * 1867 | * Checks if file exists in path. 1868 | * Opens a file when it's exists 1869 | * 1870 | * ``` php 1871 | * seeFileFound('UserModel.php','app/models'); 1873 | * ?> 1874 | * ``` 1875 | * 1876 | * @param $filename 1877 | * @param string $path 1878 | * Conditional Assertion: Test won't be stopped on fail 1879 | * @see \Codeception\Module\Filesystem::seeFileFound() 1880 | */ 1881 | public function canSeeFileFound($filename, $path = null) { 1882 | return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeFileFound', func_get_args())); 1883 | } 1884 | /** 1885 | * [!] Method is generated. Documentation taken from corresponding module. 1886 | * 1887 | * Checks if file exists in path. 1888 | * Opens a file when it's exists 1889 | * 1890 | * ``` php 1891 | * seeFileFound('UserModel.php','app/models'); 1893 | * ?> 1894 | * ``` 1895 | * 1896 | * @param $filename 1897 | * @param string $path 1898 | * @see \Codeception\Module\Filesystem::seeFileFound() 1899 | */ 1900 | public function seeFileFound($filename, $path = null) { 1901 | return $this->scenario->runStep(new \Codeception\Step\Assertion('seeFileFound', func_get_args())); 1902 | } 1903 | 1904 | 1905 | /** 1906 | * [!] Method is generated. Documentation taken from corresponding module. 1907 | * 1908 | * Checks if file does not exists in path 1909 | * 1910 | * @param $filename 1911 | * @param string $path 1912 | * Conditional Assertion: Test won't be stopped on fail 1913 | * @see \Codeception\Module\Filesystem::dontSeeFileFound() 1914 | */ 1915 | public function cantSeeFileFound($filename, $path = null) { 1916 | return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeFileFound', func_get_args())); 1917 | } 1918 | /** 1919 | * [!] Method is generated. Documentation taken from corresponding module. 1920 | * 1921 | * Checks if file does not exists in path 1922 | * 1923 | * @param $filename 1924 | * @param string $path 1925 | * @see \Codeception\Module\Filesystem::dontSeeFileFound() 1926 | */ 1927 | public function dontSeeFileFound($filename, $path = null) { 1928 | return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeFileFound', func_get_args())); 1929 | } 1930 | 1931 | 1932 | /** 1933 | * [!] Method is generated. Documentation taken from corresponding module. 1934 | * 1935 | * Erases directory contents 1936 | * 1937 | * ``` php 1938 | * cleanDir('logs'); 1940 | * ?> 1941 | * ``` 1942 | * 1943 | * @param $dirname 1944 | * @see \Codeception\Module\Filesystem::cleanDir() 1945 | */ 1946 | public function cleanDir($dirname) { 1947 | return $this->scenario->runStep(new \Codeception\Step\Action('cleanDir', func_get_args())); 1948 | } 1949 | 1950 | 1951 | /** 1952 | * [!] Method is generated. Documentation taken from corresponding module. 1953 | * 1954 | * Saves contents to file 1955 | * 1956 | * @param $filename 1957 | * @param $contents 1958 | * @see \Codeception\Module\Filesystem::writeToFile() 1959 | */ 1960 | public function writeToFile($filename, $contents) { 1961 | return $this->scenario->runStep(new \Codeception\Step\Action('writeToFile', func_get_args())); 1962 | } 1963 | } 1964 | -------------------------------------------------------------------------------- /tests/acceptance/CommandGeneratorCept.php: -------------------------------------------------------------------------------- 1 | wantTo('generate both a command and a handler class.'); 5 | 6 | $I->runShellCommand('php artisan commander:generate Acme/Bar/FooCommand --properties="bar, baz" --base="tests/tmp"'); 7 | 8 | $I->seeInShellOutput('All done!'); 9 | 10 | $I->openFile('tests/tmp/Acme/Bar/FooCommand.php'); 11 | $I->seeFileContentsEqual(file_get_contents('tests/acceptance/stubs/FooCommand.stub')); 12 | $I->cleanDir('tests/tmp/Acme/Bar'); -------------------------------------------------------------------------------- /tests/acceptance/_bootstrap.php: -------------------------------------------------------------------------------- 1 | bar = $bar; 12 | $this->baz = $baz; 13 | } 14 | 15 | } -------------------------------------------------------------------------------- /tests/functional.suite.yml: -------------------------------------------------------------------------------- 1 | # Codeception Test Suite Configuration 2 | 3 | # suite for functional (integration) tests. 4 | # emulate web requests and make application process them. 5 | # Include one of framework modules (Symfony2, Yii2, Laravel4) to use it. 6 | 7 | class_name: FunctionalTester 8 | modules: 9 | enabled: [Filesystem, FunctionalHelper] 10 | -------------------------------------------------------------------------------- /tests/functional/FunctionalTester.php: -------------------------------------------------------------------------------- 1 | scenario->runStep(new \Codeception\Step\Condition('amInPath', func_get_args())); 38 | } 39 | 40 | 41 | /** 42 | * [!] Method is generated. Documentation taken from corresponding module. 43 | * 44 | * Opens a file and stores it's content. 45 | * 46 | * Usage: 47 | * 48 | * ``` php 49 | * openFile('composer.json'); 51 | * $I->seeInThisFile('codeception/codeception'); 52 | * ?> 53 | * ``` 54 | * 55 | * @param $filename 56 | * @see \Codeception\Module\Filesystem::openFile() 57 | */ 58 | public function openFile($filename) { 59 | return $this->scenario->runStep(new \Codeception\Step\Action('openFile', func_get_args())); 60 | } 61 | 62 | 63 | /** 64 | * [!] Method is generated. Documentation taken from corresponding module. 65 | * 66 | * Deletes a file 67 | * 68 | * ``` php 69 | * deleteFile('composer.lock'); 71 | * ?> 72 | * ``` 73 | * 74 | * @param $filename 75 | * @see \Codeception\Module\Filesystem::deleteFile() 76 | */ 77 | public function deleteFile($filename) { 78 | return $this->scenario->runStep(new \Codeception\Step\Action('deleteFile', func_get_args())); 79 | } 80 | 81 | 82 | /** 83 | * [!] Method is generated. Documentation taken from corresponding module. 84 | * 85 | * Deletes directory with all subdirectories 86 | * 87 | * ``` php 88 | * deleteDir('vendor'); 90 | * ?> 91 | * ``` 92 | * 93 | * @param $dirname 94 | * @see \Codeception\Module\Filesystem::deleteDir() 95 | */ 96 | public function deleteDir($dirname) { 97 | return $this->scenario->runStep(new \Codeception\Step\Action('deleteDir', func_get_args())); 98 | } 99 | 100 | 101 | /** 102 | * [!] Method is generated. Documentation taken from corresponding module. 103 | * 104 | * Copies directory with all contents 105 | * 106 | * ``` php 107 | * copyDir('vendor','old_vendor'); 109 | * ?> 110 | * ``` 111 | * 112 | * @param $src 113 | * @param $dst 114 | * @see \Codeception\Module\Filesystem::copyDir() 115 | */ 116 | public function copyDir($src, $dst) { 117 | return $this->scenario->runStep(new \Codeception\Step\Action('copyDir', func_get_args())); 118 | } 119 | 120 | 121 | /** 122 | * [!] Method is generated. Documentation taken from corresponding module. 123 | * 124 | * Checks If opened file has `text` in it. 125 | * 126 | * Usage: 127 | * 128 | * ``` php 129 | * openFile('composer.json'); 131 | * $I->seeInThisFile('codeception/codeception'); 132 | * ?> 133 | * ``` 134 | * 135 | * @param $text 136 | * Conditional Assertion: Test won't be stopped on fail 137 | * @see \Codeception\Module\Filesystem::seeInThisFile() 138 | */ 139 | public function canSeeInThisFile($text) { 140 | return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeInThisFile', func_get_args())); 141 | } 142 | /** 143 | * [!] Method is generated. Documentation taken from corresponding module. 144 | * 145 | * Checks If opened file has `text` in it. 146 | * 147 | * Usage: 148 | * 149 | * ``` php 150 | * openFile('composer.json'); 152 | * $I->seeInThisFile('codeception/codeception'); 153 | * ?> 154 | * ``` 155 | * 156 | * @param $text 157 | * @see \Codeception\Module\Filesystem::seeInThisFile() 158 | */ 159 | public function seeInThisFile($text) { 160 | return $this->scenario->runStep(new \Codeception\Step\Assertion('seeInThisFile', func_get_args())); 161 | } 162 | 163 | 164 | /** 165 | * [!] Method is generated. Documentation taken from corresponding module. 166 | * 167 | * Checks the strict matching of file contents. 168 | * Unlike `seeInThisFile` will fail if file has something more then expected lines. 169 | * Better to use with HEREDOC strings. 170 | * Matching is done after removing "\r" chars from file content. 171 | * 172 | * ``` php 173 | * openFile('process.pid'); 175 | * $I->seeFileContentsEqual('3192'); 176 | * ?> 177 | * ``` 178 | * 179 | * @param $text 180 | * Conditional Assertion: Test won't be stopped on fail 181 | * @see \Codeception\Module\Filesystem::seeFileContentsEqual() 182 | */ 183 | public function canSeeFileContentsEqual($text) { 184 | return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeFileContentsEqual', func_get_args())); 185 | } 186 | /** 187 | * [!] Method is generated. Documentation taken from corresponding module. 188 | * 189 | * Checks the strict matching of file contents. 190 | * Unlike `seeInThisFile` will fail if file has something more then expected lines. 191 | * Better to use with HEREDOC strings. 192 | * Matching is done after removing "\r" chars from file content. 193 | * 194 | * ``` php 195 | * openFile('process.pid'); 197 | * $I->seeFileContentsEqual('3192'); 198 | * ?> 199 | * ``` 200 | * 201 | * @param $text 202 | * @see \Codeception\Module\Filesystem::seeFileContentsEqual() 203 | */ 204 | public function seeFileContentsEqual($text) { 205 | return $this->scenario->runStep(new \Codeception\Step\Assertion('seeFileContentsEqual', func_get_args())); 206 | } 207 | 208 | 209 | /** 210 | * [!] Method is generated. Documentation taken from corresponding module. 211 | * 212 | * Checks If opened file doesn't contain `text` in it 213 | * 214 | * ``` php 215 | * openFile('composer.json'); 217 | * $I->dontSeeInThisFile('codeception/codeception'); 218 | * ?> 219 | * ``` 220 | * 221 | * @param $text 222 | * Conditional Assertion: Test won't be stopped on fail 223 | * @see \Codeception\Module\Filesystem::dontSeeInThisFile() 224 | */ 225 | public function cantSeeInThisFile($text) { 226 | return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInThisFile', func_get_args())); 227 | } 228 | /** 229 | * [!] Method is generated. Documentation taken from corresponding module. 230 | * 231 | * Checks If opened file doesn't contain `text` in it 232 | * 233 | * ``` php 234 | * openFile('composer.json'); 236 | * $I->dontSeeInThisFile('codeception/codeception'); 237 | * ?> 238 | * ``` 239 | * 240 | * @param $text 241 | * @see \Codeception\Module\Filesystem::dontSeeInThisFile() 242 | */ 243 | public function dontSeeInThisFile($text) { 244 | return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeInThisFile', func_get_args())); 245 | } 246 | 247 | 248 | /** 249 | * [!] Method is generated. Documentation taken from corresponding module. 250 | * 251 | * Deletes a file 252 | * @see \Codeception\Module\Filesystem::deleteThisFile() 253 | */ 254 | public function deleteThisFile() { 255 | return $this->scenario->runStep(new \Codeception\Step\Action('deleteThisFile', func_get_args())); 256 | } 257 | 258 | 259 | /** 260 | * [!] Method is generated. Documentation taken from corresponding module. 261 | * 262 | * Checks if file exists in path. 263 | * Opens a file when it's exists 264 | * 265 | * ``` php 266 | * seeFileFound('UserModel.php','app/models'); 268 | * ?> 269 | * ``` 270 | * 271 | * @param $filename 272 | * @param string $path 273 | * Conditional Assertion: Test won't be stopped on fail 274 | * @see \Codeception\Module\Filesystem::seeFileFound() 275 | */ 276 | public function canSeeFileFound($filename, $path = null) { 277 | return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeFileFound', func_get_args())); 278 | } 279 | /** 280 | * [!] Method is generated. Documentation taken from corresponding module. 281 | * 282 | * Checks if file exists in path. 283 | * Opens a file when it's exists 284 | * 285 | * ``` php 286 | * seeFileFound('UserModel.php','app/models'); 288 | * ?> 289 | * ``` 290 | * 291 | * @param $filename 292 | * @param string $path 293 | * @see \Codeception\Module\Filesystem::seeFileFound() 294 | */ 295 | public function seeFileFound($filename, $path = null) { 296 | return $this->scenario->runStep(new \Codeception\Step\Assertion('seeFileFound', func_get_args())); 297 | } 298 | 299 | 300 | /** 301 | * [!] Method is generated. Documentation taken from corresponding module. 302 | * 303 | * Checks if file does not exists in path 304 | * 305 | * @param $filename 306 | * @param string $path 307 | * Conditional Assertion: Test won't be stopped on fail 308 | * @see \Codeception\Module\Filesystem::dontSeeFileFound() 309 | */ 310 | public function cantSeeFileFound($filename, $path = null) { 311 | return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeFileFound', func_get_args())); 312 | } 313 | /** 314 | * [!] Method is generated. Documentation taken from corresponding module. 315 | * 316 | * Checks if file does not exists in path 317 | * 318 | * @param $filename 319 | * @param string $path 320 | * @see \Codeception\Module\Filesystem::dontSeeFileFound() 321 | */ 322 | public function dontSeeFileFound($filename, $path = null) { 323 | return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeFileFound', func_get_args())); 324 | } 325 | 326 | 327 | /** 328 | * [!] Method is generated. Documentation taken from corresponding module. 329 | * 330 | * Erases directory contents 331 | * 332 | * ``` php 333 | * cleanDir('logs'); 335 | * ?> 336 | * ``` 337 | * 338 | * @param $dirname 339 | * @see \Codeception\Module\Filesystem::cleanDir() 340 | */ 341 | public function cleanDir($dirname) { 342 | return $this->scenario->runStep(new \Codeception\Step\Action('cleanDir', func_get_args())); 343 | } 344 | 345 | 346 | /** 347 | * [!] Method is generated. Documentation taken from corresponding module. 348 | * 349 | * Saves contents to file 350 | * 351 | * @param $filename 352 | * @param $contents 353 | * @see \Codeception\Module\Filesystem::writeToFile() 354 | */ 355 | public function writeToFile($filename, $contents) { 356 | return $this->scenario->runStep(new \Codeception\Step\Action('writeToFile', func_get_args())); 357 | } 358 | } 359 | -------------------------------------------------------------------------------- /tests/functional/_bootstrap.php: -------------------------------------------------------------------------------- 1 | scenario->runStep(new \Codeception\Step\Action('assertEquals', func_get_args())); 41 | } 42 | 43 | 44 | /** 45 | * [!] Method is generated. Documentation taken from corresponding module. 46 | * 47 | * Checks that two variables are not equal 48 | * 49 | * @param $expected 50 | * @param $actual 51 | * @param string $message 52 | * @see \Codeception\Module\Asserts::assertNotEquals() 53 | */ 54 | public function assertNotEquals($expected, $actual, $message = null) { 55 | return $this->scenario->runStep(new \Codeception\Step\Action('assertNotEquals', func_get_args())); 56 | } 57 | 58 | 59 | /** 60 | * [!] Method is generated. Documentation taken from corresponding module. 61 | * 62 | * Checks that expected is greater then actual 63 | * 64 | * @param $expected 65 | * @param $actual 66 | * @param string $message 67 | * @see \Codeception\Module\Asserts::assertGreaterThen() 68 | */ 69 | public function assertGreaterThen($expected, $actual, $message = null) { 70 | return $this->scenario->runStep(new \Codeception\Step\Action('assertGreaterThen', func_get_args())); 71 | } 72 | 73 | 74 | /** 75 | * [!] Method is generated. Documentation taken from corresponding module. 76 | * 77 | * Checks that expected is greater or equal then actual 78 | * 79 | * @param $expected 80 | * @param $actual 81 | * @param string $message 82 | * @see \Codeception\Module\Asserts::assertGreaterThenOrEqual() 83 | */ 84 | public function assertGreaterThenOrEqual($expected, $actual, $message = null) { 85 | return $this->scenario->runStep(new \Codeception\Step\Action('assertGreaterThenOrEqual', func_get_args())); 86 | } 87 | 88 | 89 | /** 90 | * [!] Method is generated. Documentation taken from corresponding module. 91 | * 92 | * Checks that haystack contains needle 93 | * 94 | * @param $needle 95 | * @param $haystack 96 | * @param string $message 97 | * @see \Codeception\Module\Asserts::assertContains() 98 | */ 99 | public function assertContains($needle, $haystack, $message = null) { 100 | return $this->scenario->runStep(new \Codeception\Step\Action('assertContains', func_get_args())); 101 | } 102 | 103 | 104 | /** 105 | * [!] Method is generated. Documentation taken from corresponding module. 106 | * 107 | * Checks that haystack doesn't contain needle. 108 | * 109 | * @param $needle 110 | * @param $haystack 111 | * @param string $message 112 | * @see \Codeception\Module\Asserts::assertNotContains() 113 | */ 114 | public function assertNotContains($needle, $haystack, $message = null) { 115 | return $this->scenario->runStep(new \Codeception\Step\Action('assertNotContains', func_get_args())); 116 | } 117 | 118 | 119 | /** 120 | * [!] Method is generated. Documentation taken from corresponding module. 121 | * 122 | * Checks that variable is empty. 123 | * 124 | * @param $actual 125 | * @param string $message 126 | * @see \Codeception\Module\Asserts::assertEmpty() 127 | */ 128 | public function assertEmpty($actual, $message = null) { 129 | return $this->scenario->runStep(new \Codeception\Step\Action('assertEmpty', func_get_args())); 130 | } 131 | 132 | 133 | /** 134 | * [!] Method is generated. Documentation taken from corresponding module. 135 | * 136 | * Checks that variable is not empty. 137 | * 138 | * @param $actual 139 | * @param string $message 140 | * @see \Codeception\Module\Asserts::assertNotEmpty() 141 | */ 142 | public function assertNotEmpty($actual, $message = null) { 143 | return $this->scenario->runStep(new \Codeception\Step\Action('assertNotEmpty', func_get_args())); 144 | } 145 | 146 | 147 | /** 148 | * [!] Method is generated. Documentation taken from corresponding module. 149 | * 150 | * Checks that variable is NULL 151 | * 152 | * @param $actual 153 | * @param string $message 154 | * @see \Codeception\Module\Asserts::assertNull() 155 | */ 156 | public function assertNull($actual, $message = null) { 157 | return $this->scenario->runStep(new \Codeception\Step\Action('assertNull', func_get_args())); 158 | } 159 | 160 | 161 | /** 162 | * [!] Method is generated. Documentation taken from corresponding module. 163 | * 164 | * Checks that variable is not NULL 165 | * 166 | * @param $actual 167 | * @param string $message 168 | * @see \Codeception\Module\Asserts::assertNotNull() 169 | */ 170 | public function assertNotNull($actual, $message = null) { 171 | return $this->scenario->runStep(new \Codeception\Step\Action('assertNotNull', func_get_args())); 172 | } 173 | 174 | 175 | /** 176 | * [!] Method is generated. Documentation taken from corresponding module. 177 | * 178 | * Checks that condition is positive. 179 | * 180 | * @param $condition 181 | * @param string $message 182 | * @see \Codeception\Module\Asserts::assertTrue() 183 | */ 184 | public function assertTrue($condition, $message = null) { 185 | return $this->scenario->runStep(new \Codeception\Step\Action('assertTrue', func_get_args())); 186 | } 187 | 188 | 189 | /** 190 | * [!] Method is generated. Documentation taken from corresponding module. 191 | * 192 | * Checks that condition is negative. 193 | * 194 | * @param $condition 195 | * @param string $message 196 | * @see \Codeception\Module\Asserts::assertFalse() 197 | */ 198 | public function assertFalse($condition, $message = null) { 199 | return $this->scenario->runStep(new \Codeception\Step\Action('assertFalse', func_get_args())); 200 | } 201 | 202 | 203 | /** 204 | * [!] Method is generated. Documentation taken from corresponding module. 205 | * 206 | * Fails the test with message. 207 | * 208 | * @param $message 209 | * @see \Codeception\Module\Asserts::fail() 210 | */ 211 | public function fail($message) { 212 | return $this->scenario->runStep(new \Codeception\Step\Action('fail', func_get_args())); 213 | } 214 | } 215 | -------------------------------------------------------------------------------- /tests/unit/_bootstrap.php: -------------------------------------------------------------------------------- 1 |