-
-
Notifications
You must be signed in to change notification settings - Fork 326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace SPOON_CHARSET by $container->getParameter('kernel.charset') #1140
Replace SPOON_CHARSET by $container->getParameter('kernel.charset') #1140
Conversation
somebody's on a roll! 👍 |
@WouterSioen If everybody continues to contribute its share of the pie. The symfony conversion will be over soon and w'll be able to create amazing sh*t! |
You went to fast here. The tests are failing. This could give you a hint: https://travis-ci.org/forkcms/forkcms/jobs/54884901 |
Strange, I don't get any error in the backend. I even can use that truncate function without problems... |
Is it possible that it fails because 'kernel.charset' is not set in any parameters files (f.e.: parameters.yml.travis) |
Because it's a unit test, there is no backend model containing a container yet. I would do this: create a mock object "container" that returns 'UTF-8' when getParameter('kernel.charset') is called. Then do a "BackendModel::setContainer()" with this mock object. If you need more info to create this, I'd be happy to help. |
You could do something like this: $containerMock = $this
->getMockBuilder('Symfony\Component\DependencyInjection\ContainerInterface')
->disableOriginalConstructor()
->getMock()
;
$containerMock->expects($this->any())
->method('getParameter')
->with('kernel.charset')
->will($this->returnValue('UTF-8'))
;
BackendModel::setContainer($containerMock); Something like this should work. |
Note that you should also be able to remove the |
And in the frontend the same for frontend. |
👍 |
I'll squash and merge this |
merged |
Fixes #1138