Mock type | Tests duration |
---|---|
Native mocks | 160.10 seconds |
Mockery | 177.01 seconds (+10%) |
PHPUnit mocks | 232.29 seconds (+45%) |
Prophecy | 3868.80 seconds (+2416%) |
Stuart talking about them as part of the Day of Datomic videos:
https://youtu.be/ZP-E2IgqKfA?t=2412
Simple data structure for anomalies.
<?php | |
namespace AppBundle\Form; | |
use Symfony\Component\Form\AbstractType; | |
use Symfony\Component\Form\Extension\Core\Type\PasswordType; | |
use Symfony\Component\Form\Extension\Core\Type\RepeatedType; | |
use Symfony\Component\Form\Extension\Core\Type\SubmitType; | |
use Symfony\Component\Form\FormBuilderInterface; |
Testing React components seems simple at first. Then you need to test something that isn't a pure interaction and things seem to break down. These 4 patterns should help you write readable, flexible tests for the type of component you are testing.
I recommend doing all setup in the most functional way possible. If you can avoid it, don't set variables in a
beforeEach
. This will help ensure tests are isolated and make things a bit easier to reason about. I use a pattern
that gives great defaults for each test example but allows every example to override props
when needed:
Ок. У нас сегодня последняя большая тема, в выходные будет формат полегче. Перед тем как к ней переходить несколько тезисов из прошлых дней:
- Я считаю что модель верстки компонентами для любого крупного проекта подходит лучше, чем любай другая.
- Компонент включает HTML, CSS, JS, тесты, локализации, мануал и т. д. Эти файлы проще всего хранить и использовать вместе.
- Браузер это ассемблер которому мы кормим оптимизированный машинный код в разных форматах.
- CSS, JS и HTML должны знать структуру друг друга, это позволяет гораздо эффективнее их сокращать, пожимать и оптимизировать.
Использование в последние годы штук вроде Webpack, React и CSS Modules меня лично убедило что при таком подходе к коду жить проще и приятнее.
Это все хорошо пока ты делаешь SPA, но есть проекты которым противопаказано быть SPA, а пользы от компонентов и оптимизаций было бы много.
* { | |
font-size: 12pt; | |
font-family: monospace; | |
font-weight: normal; | |
font-style: normal; | |
text-decoration: none; | |
color: black; | |
cursor: default; | |
} |
[user] | |
name = Evgeny V. Generalov | |
email = [email protected] | |
[alias] | |
st = status | |
ci = commit | |
co = checkout | |
wc = diff --staged | |
br = branch |
# | |
# Ubuntu 14.04 LTS (Trusty Tahr) | |
# | |
# Basic packages i usually install | |
# | |
# Author: Julius Beckmann <[email protected]> | |
# | |
# For 16.04 Xenial Xerus: https://gist.github.com/h4cc/fe48ed9d85bfff3008704919062f5c9b | |
# |
{ | |
"name": "My Project", | |
"homepage": "http://satis", | |
"output-dir": "web", | |
"repositories": [ | |
{ "type": "vcs", "url": "https://github.com/symfony/symfony" }, | |
{ "type": "vcs", "url": "https://github.com/symfony/Icu" }, | |
{ "type": "vcs", "url": "https://github.com/doctrine/common" }, | |
{ "type": "vcs", "url": "https://github.com/php-fig/log" }, | |
{ "type": "vcs", "url": "https://github.com/doctrine/inflector" }, |
# Can force this into php/recipes/package.rb | |
# Or if you're like me and use a cookbook to provision with chef-solo... | |
# add this near the top of your file before you update apt | |
# Use PHP 5.4 | |
apt_repository "php54" do | |
uri "http://ppa.launchpad.net/ondrej/php5-oldstable/ubuntu" | |
distribution node['lsb']['codename'] | |
components ["main"] | |
keyserver "keyserver.ubuntu.com" |