I want to upgrade symfony 2.8 project to 3.0, i changed the version in composer.json to 3.0.* but after composer update is done, i have these error in console:
[RuntimeException]
An error occurred when executing the "'cache:clear --no-warmup'" command:
PHP Fatal error: Class 'Symfony\Component\HttpKernel\Kernel' not found in
/var/www/html/t/EcoPro/app/AppKernel.php on line 6
It sounds like your code can't find the Kernel class from Symfony. Since it should still be there, as you can see in the Symfony repository in the 3.0-branch I assume something went wrong during your update.
I suggest first running composer diagnose to see if composer itself is up to date and your composer.json is syntactically valid. As a next step you should verify the current version of your dependencies by running composer show. The output should look something like this:
$ composer show
doctrine/annotations v1.2.7 Docblock Annotations Parser
doctrine/cache v1.5.1 Caching library offering an object-oriented API for many cache backends
doctrine/collections v1.3.0 Collections Abstraction library
doctrine/common v2.5.1 Common Library for Doctrine projects
doctrine/dbal v2.5.2 Database Abstraction Layer
doctrine/doctrine-bundle 1.6.0 Symfony DoctrineBundle
doctrine/doctrine-cache-bundle 1.2.2 Symfony Bundle for Doctrine Cache
doctrine/inflector v1.1.0 Common String Manipulations with regard to casing and singular/plural rules.
doctrine/instantiator 1.0.5 A small, lightweight utility to instantiate objects in PHP without invoking their constructors
doctrine/lexer v1.0.1 Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.
doctrine/orm v2.5.2 Object-Relational-Mapper for PHP
incenteev/composer-parameter-handler v2.1.2 Composer script handling your ignored parameter file
jdorn/sql-formatter v1.2.17 a PHP SQL highlighting library
monolog/monolog 1.17.2 Sends your logs to files, sockets, inboxes, databases and various web services
paragonie/random_compat 1.1.0 PHP 5.x polyfill for random_bytes() and random_int() from PHP 7
psr/log 1.0.0 Common interface for logging libraries
sensio/distribution-bundle v5.0.2 Base bundle for Symfony Distributions
sensio/framework-extra-bundle v3.0.11 This bundle provides a way to configure your controllers with annotations
sensio/generator-bundle v3.0.0 This bundle generates code for you
sensiolabs/security-checker v3.0.2 A security checker for your composer.lock
swiftmailer/swiftmailer v5.4.1 Swiftmailer, free feature-rich PHP mailer
symfony/monolog-bundle v2.8.2 Symfony MonologBundle
symfony/phpunit-bridge v2.8.0 Symfony PHPUnit Bridge
symfony/polyfill-intl-icu v1.0.0 Symfony polyfill for intl's ICU-related data and classes
symfony/polyfill-mbstring v1.0.0 Symfony polyfill for the Mbstring extension
symfony/polyfill-php56 v1.0.0 Symfony polyfill backporting some PHP 5.6+ features to lower PHP versions
symfony/polyfill-php70 v1.0.0 Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions
symfony/polyfill-util v1.0.0 Symfony utilities for portability of PHP codes
symfony/swiftmailer-bundle v2.3.9 Symfony SwiftmailerBundle
symfony/symfony v3.0.0 The Symfony PHP framework
twig/twig v1.23.1 Twig, the flexible, fast, and secure template language for PHP
This should help you see whether the update actually worked. If all looks fine, I would go the safe route and revert your code back to 2.8 and then do the update like explained below, instead of changing the composer.json!
First make sure you fixed all deprecations in your existing application. You can use the UPGRADE-document as reference, but also run your tests and check the logs for deprecated calls. This will become easier with 3.3+ as these versions have a separate deprecation-log that you can find in var/log alongside the other log files.
Once you are reasonably sure you code will run with a new major version, just use the following composer command:
composer require symfony/lts:"^3.0"
This is only to make sure that we don't accidentally install any Symfony component that is 4.0 during the process. Once you want to upgrade to Symfony 4 you can just remove this dependency using composer remove symfony/lts and then run update.
After the lts meta package is in place you can update Symfony itself:
composer require symfony/symfony:^3.0
to update to the newest 3.x that your dependencies support or use a stricter constraint if you really want to go step by step:
composer require symfony/symfony:3.0.*
You can also do both things in one step if you like:
$ composer require symfony/lts:^3.0 symfony/symfony:^3.0
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 5 installs, 2 updates, 0 removals
- Updating symfony/symfony (v2.8.32 => v3.4.2): Downloading (100%)
- Installing psr/simple-cache (1.0.0): Loading from cache
- Installing psr/link (1.0.0): Loading from cache
- Installing psr/container (1.0.0): Loading from cache
- Installing psr/cache (1.0.1): Loading from cache
- Installing fig/link-util (1.0.0): Loading from cache
Writing lock file
Generating autoload files
> Incenteev\ParameterHandler\ScriptHandler::buildParameters
Updating the "app/config/parameters.yml" file
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache
// Clearing the cache for the dev environment with debug
// true
[OK] Cache for the "dev" environment (debug=true) was successfully cleared.
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installAssets
Trying to install assets as relative symbolic links.
[OK] No assets were provided by any bundle.
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installRequirementsFile
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::prepareDeploymentTarget
This should already be enough to have Symfony on the newer version. You will likely have other dependencies such as Doctrine or some bundles that you have installed as well. There are a few useful commands for updating them.
First you can update only a single dependency at a time:
composer update doctrine/orm
When you add the option --with-dependencies it will also update doctrine/orm's dependencies.
You can always ask composer why or composer why-not with a dependency and optionally a version to check why a dependency is there and why it won't update. Just type composer help why-not to see how to use it. This is particularly helpful when you want to update a dependency like doctrine/orm, but composer throws an error that it can't do it.
Related
I followed both the Codeception and general PHP instructions in our wiki when I set up my project in PhpStorm. It worked perfectly with both the ./vendor/bin/codecept run and docker-compose run --rm codecept run ui_automation --env staging --debug for over a day. Now, when I run the same project, it attempts the first test and just hangs at this part:
julie#Julies-MacBook-Pro qa-tests % ./vendor/bin/codecept run
Codeception PHP Testing Framework v4.1.9
Powered by PHPUnit 9.4.2 by Sebastian Bergmann and contributors.
Running with seed:
Ui_automation Tests (2) --------------------------------------------------------------------
------------------------------------------------------------------------
- LoginCest: Test login
My environment is as such:
php 7.4.12
Mac OS Catalina 10.15.6
Composer 2.0.5
Codecept 4.1.11
Docker 19.03.13
And when I try to run it with the docker command I get this error. I was originally getting this error with the above command too but now I'm just getting it for the docker command:
julie#Julies-MacBook-Pro qa-tests % docker-compose run --rm codecept run ui_automation --
env staging --debug
Starting qa-end-to-end-tests_db_1 ... done
Creating qa-end-to-end-tests_codecept_run ... done
==== Redirecting to Composer-installed version in vendor/codeception. You can skip this
using --no-redirect ====
Command "run " is not defined.
I wasn't doing anything other than adding locators when this problem suddenly appeared. Also I used to verify the flow through a VNCView window and I can see there that my project is pulling up Chrome but not going to any page.
https://github.com/Codeception/Codeception/issues/5495 says about the redirect line in the error, "This redirect is here for a reason - it prevents odd errors when different versions of Codeception or dependencies are installed in vendor dir and external locations and some classes are loaded from one place and some - from another." But, it doesn't give tips on how to resolve this.
I initially was following two sets of instructions, I may have set up composer twice (once with wget and once with homebrew) and tried fixing from that angle. I also was setting up my mac in it's entirety the same day so it's possible I downloaded something else that is somehow conflicting.
I have tried the following:
Using both PhpStorm and VSCode, both IDEs display the same behavior
Running ./vendor/bin/codecept clean and .vendor/bin/codecept build
Updating with "composer update" command
restarting IDEs, computer
Deleted composer according to these instructions: Remove composer
Re-installed composer with homebrew only
Uninstalled and reinstalled docker according to these instructions: https://nektony.com/how-to/uninstall-docker-on-mac
Added codeception/verify and codeception/specify to my composer.json
Made sure the URL the page is supposed to go to is still in my yaml file under Webdriver, URL
Noticed a "No CLI interpreter" in my Edit Configuration page in IntelliJ so re-added that and set PHP 7.4 to Interpreter). This was using the executable /usr/local/Cellar/php/7.4.12/bin/php
Looked in preferences and module settings, didn't see anything weird
Ran in verbose mode (-vvv) didn't get hints from that
Blew out my whole git repo and re-imported it
Ran composer show, saw many codeception packages
Ran autoload dump
Ran Tools > Composer > Diagnose in both regular and verbose and got back "Composer diagnosed some issues in ./composer.json." but it doesn't tell me what those issues are and there is nothing lit up or red in composer.json
Deleted the whole vendor folder and reinstalled composer
I now notice after the last step composer.phar is red! I have tried repeating the steps above but it is still red.
Right now I'd just like to get my project working through the regular ./vendor/bin/codecept run bc I have SREs to help with the Docker stuff, although I'd be happy to skip straight to docker working as that's how they'd like us to run it.
My composer.json (without the specify, verify troubleshooting step):
{
"require-dev": {
"codeception/robo-paracept": "^0.4.2",
"codeception/codeception": "^4.1",
"codeception/module-phpbrowser": "^1.0.0",
"codeception/module-asserts": "^1.0.0",
"codeception/module-webdriver": "^1.1",
"codeception/verify": "2.1.0",
"codeception/specify": "1.4.0",
"phpunit/phpunit": "^9.4"
},
"require": {
"ext-zip": "^1.15",
"codeception/specify": "*",
"codeception/verify": "*"
},
"autoload": {
"psr-4": {
"Tests\\Support\\": "tests/_support",
"UiAutomationTester\\": "tests/_support/UiAutomation.php"
}
}
}
I updated composer to 4.1.11 and verified that ./vendor/bin/codecept run -V matched the version in composer.json
composer -V says it's at Composer version 2.0.5
Results of composer-show:
codeception/lib-asserts 1.13.2 Assertion methods used by
Codeception core and Asserts module
codeception/lib-innerbrowser 1.3.4 Parent library for all Codeception framework modules and PhpBrowser
codeception/module-asserts 1.3.1 Codeception module containing various assertions
codeception/module-phpbrowser 1.0.2 Codeception module for testing web application over HTTP
codeception/module-webdriver 1.1.3 WebDriver module for Codeception
codeception/phpunit-wrapper 9.0.5 PHPUnit classes used by Codeception
codeception/robo-paracept 0.4.2 Codeception Parallel Execution Tasks via Robo Task Runner
codeception/stub 3.7.0 Flexible Stub wrapper for PHPUnit's Mock Builder
consolidation/annotated-command 4.2.3 Initialize Symfony Console commands from annotated command class methods.
consolidation/config 1.2.1 Provide configuration services for a commandline tool.
consolidation/log 2.0.1 Improved Psr-3 / Psr\Log logger based on Symfony Console components.
consolidation/output-formatters 4.1.1 Format text by applying transformations provided by plug-in formatters.
consolidation/robo 1.4.13 Modern task runner
consolidation/self-update 1.2.0 Provides a self:update command for Symfony Console applications.
container-interop/container-interop 1.2.0 Promoting the interoperability of container objects (DIC, SL, etc.)
dflydev/dot-access-data v1.1.0 Given a deep data structure, access data by dot notation.
doctrine/instantiator 1.3.1 A small, lightweight utility to instantiate objects in PHP without invoking their constr...
grasmash/expander 1.0.0 Expands internal property references in PHP arrays file.
grasmash/yaml-expander 1.4.0 Expands internal property references in a yaml file.
guzzlehttp/guzzle 7.2.0 Guzzle is a PHP HTTP client library
guzzlehttp/promises 1.4.0 Guzzle promises library
guzzlehttp/psr7 1.7.0 PSR-7 message implementation that also provides common utility methods
league/container 2.4.1 A fast and intuitive dependency injection container.
monolog/monolog 2.1.1 Sends your logs to files, sockets, inboxes, databases and various web services
myclabs/deep-copy 1.10.1 Create deep copies (clones) of your objects
nikic/php-parser v4.10.2 A PHP parser written in PHP
phar-io/manifest 2.0.1 Component for reading phar.io manifest information from a PHP Archive (PHAR)
phar-io/version 3.0.2 Library for handling version information and constraints
php-webdriver/webdriver 1.8.3 A PHP client for Selenium WebDriver. Previously facebook/webdriver.
phpdocumentor/reflection-common 2.2.0 Common reflection classes used by phpdocumentor to reflect the code structure
phpdocumentor/reflection-docblock 5.2.2 With this component, a library can provide support for annotations via DocBlocks or othe...
phpdocumentor/type-resolver 1.4.0 A PSR-5 based resolver of Class names, Types and Structural Element Names
phpspec/prophecy 1.12.1 Highly opinionated mocking framework for PHP 5.3+
phpunit/php-code-coverage 9.2.3 Library that provides collection, processing, and rendering functionality for PHP code c...
phpunit/php-file-iterator 3.0.5 FilterIterator implementation that filters files based on a list of suffixes.
phpunit/php-invoker 3.1.1 Invoke callables with a timeout
phpunit/php-text-template 2.0.4 Simple template engine.
phpunit/php-timer 5.0.3 Utility class for timing
phpunit/phpunit 9.4.2 The PHP Unit Testing framework.
psr/container 1.0.0 Common Container Interface (PHP FIG PSR-11)
psr/http-client 1.0.1 Common interface for HTTP clients
psr/http-message 1.0.1 Common interface for HTTP messages
psr/log 1.1.3 Common interface for logging libraries
ralouphie/getallheaders 3.0.3 A polyfill for getallheaders.
sebastian/cli-parser 1.0.1 Library for parsing CLI options
sebastian/code-unit 1.0.8 Collection of value objects that represent the PHP code units
sebastian/code-unit-reverse-lookup 2.0.3 Looks up which function or method a line of code belongs to
sebastian/comparator 4.0.6 Provides the functionality to compare PHP values for equality
sebastian/complexity 2.0.2 Library for calculating the complexity of PHP code units
sebastian/diff 4.0.4 Diff implementation
sebastian/environment 5.1.3 Provides functionality to handle HHVM/PHP environments
sebastian/exporter 4.0.3 Provides the functionality to export PHP variables for visualization
sebastian/global-state 5.0.2 Snapshotting of global state
sebastian/lines-of-code 1.0.2 Library for counting the lines of code in PHP source code
sebastian/object-enumerator 4.0.4 Traverses array structures and object graphs to enumerate all referenced objects
sebastian/object-reflector 2.0.4 Allows reflection of object attributes, including inherited and non-public ones
sebastian/recursion-context 4.0.4 Provides functionality to recursively process PHP variables
sebastian/resource-operations 3.0.3 Provides a list of PHP built-in functions that operate on resources
sebastian/type 2.3.1 Collection of value objects that represent the types of the PHP type system
sebastian/version 3.0.2 Library that helps with managing the version number of Git-hosted PHP projects
symfony/browser-kit v5.1.8 Symfony BrowserKit Component
symfony/console v4.4.16 Symfony Console Component
symfony/css-selector v5.1.8 Symfony CssSelector Component
symfony/dom-crawler v5.1.8 Symfony DomCrawler Component
symfony/event-dispatcher v4.4.16 Symfony EventDispatcher Component
symfony/event-dispatcher-contracts v1.1.9 Generic abstractions related to dispatching event
symfony/filesystem v4.4.16 Symfony Filesystem Component
symfony/finder v5.1.8 Symfony Finder Component
symfony/polyfill-ctype v1.20.0 Symfony polyfill for ctype functions
symfony/polyfill-mbstring v1.20.0 Symfony polyfill for the Mbstring extension
symfony/polyfill-php73 v1.20.0 Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions
symfony/polyfill-php80 v1.20.0 Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions
symfony/process v4.4.16 Symfony Process Component
symfony/service-contracts v2.2.0 Generic abstractions related to writing services
symfony/yaml v4.4.16 Symfony Yaml Component
theseer/tokenizer 1.2.0 A small library for converting tokenized PHP source code into XML and potentially other ...
webmozart/assert 1.9.1 Assertions to validate method input/output with nice error messages.
I don't know much about PHP set up or Codeception, this is my first project in either. This is running on everyone else's machine in QA except mine!
When I install a Symfony 4 skeleton project and add the JmsSerializerBundle, I get an error.
To reproduce:
composer create-project symfony/website-skeleton myproject
cd myproject
composer require jms/serializer-bundle
The installation ends with an error:
Using version ^3.0 for jms/serializer-bundle
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Restricting packages listed in "symfony/symfony" to "4.1.*"
Package operations: 16 installs, 0 updates, 0 removals
- Installing hoa/exception (1.17.01.16): Loading from cache
- Installing hoa/event (1.17.01.13): Loading from cache
- Installing hoa/consistency (1.17.05.02): Loading from cache
- Installing hoa/visitor (2.17.01.16): Loading from cache
- Installing hoa/ustring (4.17.01.16): Loading from cache
- Installing hoa/protocol (1.17.01.14): Loading from cache
- Installing hoa/zformat (1.17.01.10): Loading from cache
- Installing hoa/iterator (2.17.01.10): Loading from cache
- Installing hoa/compiler (3.17.08.08): Loading from cache
- Installing hoa/regex (1.17.01.13): Loading from cache
- Installing hoa/math (1.17.05.16): Loading from cache
- Installing hoa/stream (1.17.02.21): Loading from cache
- Installing hoa/file (1.17.07.11): Loading from cache
- Installing jms/metadata (2.0.0): Loading from cache
- Installing jms/serializer (2.0.0): Loading from cache
- Installing jms/serializer-bundle (3.0.0): Loading from cache
Writing lock file
Generating autoload files
ocramius/package-versions: Generating version class...
ocramius/package-versions: ...done generating version class
Symfony operations: 1 recipe (f702450e5b1b913f83ea887faacbdb83)
- WARNING jms/serializer-bundle (>=2.0): From github.com/symfony/recipes-contrib:master
The recipe for this package comes from the "contrib" repository, which is open to community contributions.
Review the recipe at https://github.com/symfony/recipes-contrib/tree/master/jms/serializer-bundle/2.0
Do you want to execute this recipe?
[y] Yes
[n] No
[a] Yes for all packages, only for the current installation session
[p] Yes permanently, never ask again for this project
(defaults to n): y
- Configuring jms/serializer-bundle (>=2.0): From github.com/symfony/recipes-contrib:master
Executing script cache:clear [KO]
[KO]
Script cache:clear returned with error code 1
!!
!! In ArrayNode.php line 304:
!!
!! Unrecognized option "xml" under "jms_serializer.visitors"
Running composer etc on Windows 10 Powershell. I'm guessing the skeleton is too bare and it needs a dependency, but shouldn't that be solved automatically?
What could be the cause? How can I fix it? Thanks in advance for your help.
The current recipe is not compatible with JMSSerializerBundle 3 (there is a pending pull request, see https://github.com/symfony/recipes-contrib/pull/559). So for now, you need to adapt the configuration manually.
I know there are many subject about composer but I won't be able to install phpword through composer.
Basically I need to install PHPWord to create word on my network server.
I install wamp on my computer, install composer and create a new folder on www.
Let's say the main directory is : www/test/
I write a composer.json file :
{
"require": {
"phpoffice/phpword": "v0.13.*"
}
}
And with command line, I tried composer install :
Failed loading c:/wamp/bin/php/php5.6.19/ext/php_xdebug-2.4.0-5.6-vc11-nts.dll
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 6 installs, 0 updates, 0 removals
- Installing pclzip/pclzip (2.8.2): Loading from cache
- Installing phpoffice/common (v0.2.6): Loading from cache
- Installing zendframework/zend-stdlib (2.4.13): Loading from cache
- Installing zendframework/zend-validator (2.4.13): Loading from cache
- Installing zendframework/zend-escaper (2.4.13): Loading from cache
- Installing phpoffice/phpword (v0.13.0): Loading from cache
zendframework/zend-stdlib suggests installing zendframework/zend-eventmanager (To support aggregate hydrator usage)
zendframework/zend-stdlib suggests installing zendframework/zend-serializer (Zend\Serializer component)
zendframework/zend-stdlib suggests installing zendframework/zend-servicemanager (To support hydrator plugin manager usage)
zendframework/zend-stdlib suggests installing zendframework/zend-filter (To support naming strategy hydrator usage)
zendframework/zend-validator suggests installing zendframework/zend-db (Zend\Db component)
zendframework/zend-validator suggests installing zendframework/zend-filter (Zend\Filter component, required by the Digits validator)
zendframework/zend-validator suggests installing zendframework/zend-i18n (Zend\I18n component to allow translation of validation error messages as well as to use the various Date validators)
zendframework/zend-validator suggests installing zendframework/zend-math (Zend\Math component)
zendframework/zend-validator suggests installing zendframework/zend-resources (Translations of validator messages)
zendframework/zend-validator suggests installing zendframework/zend-servicemanager (Zend\ServiceManager component to allow using the ValidatorPluginManager and validator chains)
zendframework/zend-validator suggests installing zendframework/zend-session (Zend\Session component)
zendframework/zend-validator suggests installing zendframework/zend-uri (Zend\Uri component, required by the Uri and Sitemap\Loc validators)
phpoffice/phpword suggests installing ext-gd2 (Allows adding images)
phpoffice/phpword suggests installing dompdf/dompdf (Allows writing PDF)
Writing lock file
Generating autoload files
So now I've got a new folder call vendor with autoload.php and many folder inside (zendframework, phpoffice...)
When I try to go to a phpword example, I've got this error :
Fatal error: Uncaught exception 'Exception' with message 'Could not find file '/autoload.php'. It is generated by Composer. Use 'install --prefer-source' or 'update --prefer-source' Composer commands to move forward.' in C:\wamp\www\Nouveau dossier (2)\vendor\phpoffice\phpword\bootstrap.php on line 22
( ! ) Exception: Could not find file '/autoload.php'. It is generated by Composer. Use 'install --prefer-source' or 'update --prefer-source' Composer commands to move forward. in C:\wamp\www\Nouveau dossier (2)\vendor\phpoffice\phpword\bootstrap.php on line 22
The path to autoload.php seems ok.
Anyone know why there is this problem ?
After I juste need to copy vendor folder to my network server ? (windows server with wamp)
Thank for your help.
I am using Symfony 3.0.9 with FosUserBundle to build my app. I recently did a composer update and now I cannot create users via UserManager or command line. The error is Integrity constraint violation: 1048 Column 'salt' cannot be null. This error occurs even when I explicitly call parent::__construct() in my constructor method as show below:
/**
* constructor.
*/
public function __construct()
{
parent::__construct();
}
And also fails if I called the setSalt method like $user->setSalt('87234hjjdwshjdsjkds')
All efforts to resolve this have failed so I started to pay close attention to my composer update command and this was some of the output:
Updating dependencies (including require-dev)
Removing twig/twig (v1.24.1)
Installing twig/twig (v1.28.2)
Loading from cache
Removing symfony/polyfill-util (v1.2.0)
Installing symfony/polyfill-util (v1.3.0)
Loading from cache
...
Removing symfony/polyfill-intl-icu (v1.2.0)
Installing symfony/polyfill-intl-icu (v1.3.0)
Loading from cache
Removing psr/log (1.0.0)
Installing psr/log (1.0.2)
Loading from cache
Removing doctrine/cache (v1.6.0)
Installing doctrine/cache (v1.6.1)
Loading from cache
...
Removing doctrine/orm (v2.5.4)
Installing doctrine/orm (v2.5.5)
Loading from cache
Removing sensiolabs/security-checker (v3.0.2)
Installing sensiolabs/security-checker (v4.0.0)
Loading from cache
Removing nikic/php-parser (v2.1.0)
Installing nikic/php-parser (v2.1.1)
Loading from cache
...
Removing doctrine/doctrine-migrations-bundle (1.1.1)
Installing doctrine/doctrine-migrations-bundle (v1.2.0)
Loading from cache
...
Removing phpspec/phpspec (2.5.1)
Installing phpspec/phpspec (2.5.5)
Loading from cache
Removing doctrine/data-fixtures (v1.2.1)
Installing doctrine/data-fixtures (v1.2.2)
Loading from cache
Updating friendsofsymfony/user-bundle dev-master (147ca68 => 7261f7a)
Checking out 7261f7aa143b4bfdb0b7ddc5df208067fa7be698
As you can see FOSUSERBUNDLE was updated.
Reverting the composer update, deleting my vendor directory and running composer install fixes it. This summed it down to the update. That was the problem.
If anyone knows how I can update and still have a working application I would be grateful for your comments and feedback.
1) If you want to use FOSUserBundle in version 2 there is no final/stable version - so you always have to expect breaking changes in a dev/master branch.
2) Since a couple of days there is a 2.0.0 Beta version at least which I heavily recommend to use in your case: Check it here.
3) There were a couple of changes regarding the User Database Schema, e.g a couple of unused fields were removed. And there is a change regarding the salt field - so in your case - as far as I can see probably the missing thing is to update your database schame (if you're working with Doctrine call bin/console doctrine:schema:update --force).
For details see e.g. the release notes for 2.0.0 beta:
[BC break] The salt field of the User class is now nullable.
If you want update everything but user-bundle
With composer you may pass package name(s) as parameter to composer update command, like this:
composer update vendor1/package1 vendor2/package2
So you can create long string of all packages except user-bundle.
List of all oudated packages you can get from
composer show -o --name-only
command output.
The option -o here is for only outdated packages which are available for update.
Option --name-only obviously shows only package name without version and description.
So, on unix-like OS you can run something like
composer show -o --name-only | grep -v 'friendsofsymfony/user-bundle' | xargs composer update
More about Composer CLI
I'm getting an error when I want to run a PHPUnit test on my Laravel 5 website. Can you give me a hint? Already updated both composer and phpunit package.
PHPUnit 5.2.12 by Sebastian Bergmann and contributors.
Starting test 'Warning'.
W
Starting test 'ExampleTest::testEncryptionIsIntelligent'.
PHP Fatal error: Call to a member function getContent() on null in /var/www/hu.testsite/vendor/laravel/framework/src/Illuminate/Foundation/Testing/InteractsWithPages.php on line 187
[Symfony\Component\Debug\Exception\FatalErrorException]
Call to a member function getContent() on null
Here is my test file:
<?
class ExampleTest extends TestCase
{
/**
* My test implementation
*/
public function testEncryptionIsIntelligent()
{
$this->see('Laravel 5');
$this->visit('/');
$this->visit('/auth/login');
$this->type('test.admin#testsite.hu', 'email');
$this->type('test', 'password');
$this->press('');
$this->seePageIs('/admin');
$this->see('Welcome to the dashboard');
$this->visit('/');
}
}
And here are the composer packages installed:
barryvdh/elfinder-flysystem-driver v0.1.4 A Flysystem Driver for elFinder
barryvdh/laravel-debugbar v2.2.0 PHP Debugbar integration for Laravel
barryvdh/laravel-elfinder v0.3.6 A Laravel Package to integrate elFinder 2
behat/behat v3.0.15 Scenario-oriented BDD framework for PHP 5.3
behat/gherkin v4.4.1 Gherkin DSL parser for PHP 5.3
behat/mink v1.7.1 Browser controller/emulator abstraction for PHP
behat/mink-browserkit-driver v1.3.2 Symfony2 BrowserKit driver for Mink framework
behat/mink-extension v2.2 Mink extension for Behat
behat/mink-goutte-driver v1.2.1 Goutte driver for Mink framework
behat/mink-selenium2-driver v1.3.1 Selenium2 (WebDriver) driver for Mink framework
behat/transliterator v1.1.0 String transliterator
classpreloader/classpreloader 3.0.0 Helps class loading performance by generating a single PHP file containing all of the autoloaded files for a specific use case
danielstjules/stringy 1.10.0 A string manipulation library with multibyte support
davejamesmiller/laravel-breadcrumbs 3.0.0 A simple Laravel-style way to create breadcrumbs in Laravel 4+.
dnoegel/php-xdg-base-dir 0.1 implementation of xdg base directory specification for php
doctrine/inflector v1.1.0 Common String Manipulations with regard to casing and singular/plural rules.
doctrine/instantiator 1.0.5 A small, lightweight utility to instantiate objects in PHP without invoking their constructors
fabpot/goutte v3.1.2 A simple PHP Web Scraper
fzaninotto/faker v1.5.0 Faker is a PHP library that generates fake data for you.
greggilbert/recaptcha 2.1.1 reCAPTCHA Validator for Laravel 5
guzzlehttp/guzzle 6.2.0 Guzzle is a PHP HTTP client library
guzzlehttp/promises 1.1.0 Guzzle promises library
guzzlehttp/psr7 1.2.3 PSR-7 message implementation
hamcrest/hamcrest-php v1.2.2 This is the PHP port of Hamcrest Matchers
illuminate/html v5.0.0
instaclick/php-webdriver 1.4.3 PHP WebDriver for Selenium 2
intervention/image 2.3.6 Image handling and manipulation library with support for Laravel integration
jakub-onderka/php-console-color 0.1
jakub-onderka/php-console-highlighter v0.3.2
jeremeamia/SuperClosure 2.2.0 Serialize Closure objects, including their context and binding
laracasts/behat-laravel-extension 1.0 Laravel extension for Behat
laravel/framework v5.1.31 The Laravel Framework.
league/flysystem 1.0.20 Filesystem abstraction: Many filesystems, one API.
maatwebsite/excel v2.1.2 An eloquent way of importing and exporting Excel and CSV in Laravel 4 with the power of PHPExcel
maximebf/debugbar v1.11.1 Debug bar in the browser for php application
mockery/mockery 0.9.4 Mockery is a simple yet flexible PHP mock object framework for use in unit testing with PHPUnit, PHPSpec or any other testing...
monolog/monolog 1.18.1 Sends your logs to files, sockets, inboxes, databases and various web services
mtdowling/cron-expression v1.1.0 CRON for PHP: Calculate the next or previous run date and determine if a CRON expression is due
myclabs/deep-copy 1.5.0 Create deep copies (clones) of your objects
nesbot/carbon 1.21.0 A simple API extension for DateTime.
nikic/php-parser v2.0.1 A PHP parser written in PHP
paragonie/random_compat v1.4.1 PHP 5.x polyfill for random_bytes() and random_int() from PHP 7
phpdocumentor/reflection-docblock 2.0.4
phpoffice/phpexcel 1.8.1 PHPExcel - OpenXML - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine
phpspec/php-diff v1.0.2 A comprehensive library for generating differences between two hashable objects (strings or arrays).
phpspec/phpspec 2.5.0 Specification-oriented BDD framework for PHP 5.3+
phpspec/prophecy v1.6.0 Highly opinionated mocking framework for PHP 5.3+
phpunit/php-code-coverage 3.3.0 Library that provides collection, processing, and rendering functionality for PHP code coverage information.
phpunit/php-file-iterator 1.4.1 FilterIterator implementation that filters files based on a list of suffixes.
phpunit/php-text-template 1.2.1 Simple template engine.
phpunit/php-timer 1.0.7 Utility class for timing
phpunit/php-token-stream 1.4.8 Wrapper around PHP's tokenizer extension.
phpunit/phpunit 5.2.12 The PHP Unit Testing framework.
phpunit/phpunit-mock-objects 3.1.0 Mock Object library for PHPUnit
psr/http-message 1.0 Common interface for HTTP messages
psr/log 1.0.0 Common interface for logging libraries
psy/psysh v0.7.2 An interactive shell for modern PHP.
sebastian/code-unit-reverse-lookup 1.0.0 Looks up which function or method a line of code belongs to
sebastian/comparator 1.2.0 Provides the functionality to compare PHP values for equality
sebastian/diff 1.4.1 Diff implementation
sebastian/environment 1.3.5 Provides functionality to handle HHVM/PHP environments
sebastian/exporter 1.2.1 Provides the functionality to export PHP variables for visualization
sebastian/global-state 1.1.1 Snapshotting of global state
sebastian/recursion-context 1.0.2 Provides functionality to recursively process PHP variables
sebastian/resource-operations 1.0.0 Provides a list of PHP built-in functions that operate on resources
sebastian/version 1.0.6 Library that helps with managing the version number of Git-hosted PHP projects
studio-42/elfinder 2.1.9 File manager for web
swiftmailer/swiftmailer v5.4.1 Swiftmailer, free feature-rich PHP mailer
symfony/browser-kit v2.8.3 Symfony BrowserKit Component
symfony/class-loader v2.8.3 Symfony ClassLoader Component
symfony/config v2.8.3 Symfony Config Component
symfony/console v2.7.10 Symfony Console Component
symfony/css-selector v2.7.10 Symfony CssSelector Component
symfony/debug v2.7.10 Symfony Debug Component
symfony/dependency-injection v2.8.3 Symfony DependencyInjection Component
symfony/dom-crawler v2.7.10 Symfony DomCrawler Component
symfony/event-dispatcher v2.8.3 Symfony EventDispatcher Component
symfony/filesystem v3.0.3 Symfony Filesystem Component
symfony/finder v2.7.10 Symfony Finder Component
symfony/http-foundation v2.7.10 Symfony HttpFoundation Component
symfony/http-kernel v2.7.10 Symfony HttpKernel Component
symfony/polyfill-apcu v1.1.1 Symfony polyfill backporting apcu_* functions to lower PHP versions
symfony/polyfill-php56 v1.1.1 Symfony polyfill backporting some PHP 5.6+ features to lower PHP versions
symfony/polyfill-util v1.1.1 Symfony utilities for portability of PHP codes
symfony/process v2.7.10 Symfony Process Component
symfony/routing v2.7.10 Symfony Routing Component
symfony/translation v2.7.10 Symfony Translation Component
symfony/var-dumper v2.7.10 Symfony mechanism for exploring and dumping PHP variables
symfony/yaml v2.8.3 Symfony Yaml Component
tijsverkoyen/css-to-inline-styles 1.5.5 CssToInlineStyles is a class that enables you to convert HTML-pages/files into HTML-pages/files with inline styles. This is v...
vlucas/phpdotenv v1.1.1 Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.
watson/sitemap 2.0.12 Generate Google Sitemaps in Laravel 4/5
And help would be appreciate.
Change this:
$this->see('Laravel 5');
$this->visit('/');
to
$this->visit('/')
->see('Laravel 5');
You are trying to first check for something that laravel is unaware of where to check for. First visit a page and then check for the content.
I would chain the lines as follows:
$this->visit('/')
->see('Laravel 5')
->visit('/auth/login')
->type('test.admin#testsite.hu', 'email')
->type('test', 'password')
->press('')
->seePageIs('/admin')
->visit('/')
->see('Welcome to the dashboard');