Mocks test implementation details. Fakes test behavior.
In hexagonal architecture, ports are promises, adapters are implementations. Mocks break this promise. Fakes keep it.
| <?php | |
| declare(strict_types=1); | |
| namespace App\Shared\Configuration; | |
| /** | |
| * Enum for configuration value types used in type assertions. | |
| */ | |
| enum ConfigValueType: string |
| # Configuration | |
| RELEASE_BRANCH ?= main | |
| CALVER_PATTERN ?= %Y.%m.%d | |
| .PHONY: release release-auto release-next-tag release-check | |
| # Interactive release (prompts for pull and confirmation) | |
| release: | |
| @RELEASE_BRANCH=$(RELEASE_BRANCH) CALVER_PATTERN=$(CALVER_PATTERN) ./scripts/release.sh release |
| <?php | |
| declare(strict_types=1); | |
| namespace App\Shared\Application\Routing; | |
| use ReflectionClass; | |
| use Symfony\Bundle\FrameworkBundle\Routing\RouteLoaderInterface; | |
| use Symfony\Component\Finder\Finder; | |
| use Symfony\Component\Routing\Attribute\Route as RouteAttribute; |
| name: Continuous Delivery | |
| on: | |
| push: | |
| branches: | |
| - 'main' | |
| tags: | |
| - 'v*.*.*' | |
| jobs: | |
| build: |
| { | |
| "title": "c-ephalogram", | |
| "blocks": { | |
| "temp/nerd": { | |
| "type": "text", | |
| "name": "thermometer", | |
| "topic": "core/nerd/temp", | |
| "initialValue": 23.42, | |
| "unit": "celsius", | |
| "description": "Temperature in Nerdarea", |
| #!/bin/bash | |
| find . -name '*.php' -type f | while read files | |
| do | |
| sedtest=$(sed -n '/^/,/$/p' "${files}" | sed -n '/<?php/p') | |
| if [ "${sedtest}" ] | |
| then | |
| echo ${files} |
| (~/code) % hhvm --version HipHop VM v2.2.0 (rel) | |
| Compiler: heads/HPHP-2.2-0-g633422a8386feb6cce6aa533a12d24d5c32b526c | |
| Repo schema: 63eda7c0b41603cdee7081a57d6f45d691ad206e | |
| (~/code) % hhvm --repo-schema 63eda7c0b41603cdee7081a57d6f45d691ad206e | |
| (~/code/composer) % git clone https://github.com/composer/composer.git Cloning into 'composer'... | |
| remote: Counting objects: 27010, done. | |
| remote: Compressing objects: 100% (15944/15944), done. | |
| remote: Total 27010 (delta 13980), reused 22055 (delta 9153) | |
| Receiving objects: 100% (27010/27010), 5.96 MiB | 674 KiB/s, done. | |
| Resolving deltas: 100% (13980/13980), done. |
| var_dump(json_encode( | |
| array() | |
| )); | |
| // [ ] | |
| var_dump(json_encode( | |
| array('foo') | |
| )); | |
| // ["foo"] |