Skip to content

Commit 823e598

Browse files
committed
📝 urls, testing, assets
1 parent 196ae36 commit 823e598

8 files changed

+69
-60
lines changed

guide/development/extensions.md

+16-13
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,40 @@
11
Packages (Extensions)
22
=====================
33

4-
It is very easy to extend a phd-based application with existing composer packages. You can integrate any Yii2
5-
extension or PHP library into phd 4.
4+
It is very easy to extend a phd-based application with existing composer packages. You can integrate any Yii2 extension or PHP library into phd.
65

7-
docker-compose run --rm php bash
6+
```
7+
docker-compose run --rm php bash
8+
```
89

910
Finding packages
1011
----------------
1112

1213
Start with a search on [Packagist](https://packagist.org) or from your command line
1314

14-
$ composer search -N "yii2-excel"
15+
```
16+
$ composer search -N "yii2-excel"
17+
```
1518

1619
Installing packages
1720
-------------------
1821

1922
To install an extension simply require it in your `composer.json` with the following command
2023

21-
$ composer require vendor/package
24+
```
25+
$ composer require vendor/package
26+
```
2227

28+
> Make sure to commit your `composer.lock` file, so your co-developers get the exact same version.
2329
24-
25-
> Make sure to commit your `composer.lock` file, so your co-developers get the exact same version.
26-
2730
Configuring packages
2831
--------------------
2932

30-
How to configure a package depends on the package and it's type. In general you can follow Yii's rules for application
31-
module and component configuration.
32-
33-
33+
How to configure a package depends on the package and it's type. In general you can follow Yii's rules for application module and component configuration.
34+
3435
Show installed packages
3536
-----------------------
3637

37-
$ composer show --installed
38+
```
39+
$ composer show --installed
40+
```

guide/development/testing.md

+14-14
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ For acceptance or end-to-end tests for example you might want to use a "real" Se
1717

1818
Creating and running a test environment can be a cumbersome task, like executing your tests in an isolated database.
1919

20-
Therefore the phd 4 Docker images contain pre-installed Codeception binaries for running Yii 2.0 Framework unit-, functional- and acceptance-test-suites.
20+
Therefore the phd Docker images contain pre-installed Codeception binaries for running Yii 2.0 Framework unit-, functional- and acceptance-test-suites.
2121

2222
### Configuration
2323

@@ -53,6 +53,7 @@ Run codeception directly *(container bash)*
5353
make bash
5454
$ codecept run
5555

56+
> :bulb: Basically tests should be independent from each other. But depending on your setup `cli` tests can be used to initialize the test environment for the application.
5657
5758
### Advanced usage
5859

@@ -82,15 +83,6 @@ $ codecept run functional --coverage --coverage-html
8283
```
8384

8485

85-
86-
### FAQ
87-
88-
#### Functional vs. acceptance tests
89-
90-
Due to limitations functional-testing should only be used for basic tests, see codeception.com
91-
92-
For Login, JavaScript, Cookies, Session, ... use acceptance tests. See commands `wait(1)`, `waitForElement(1)`.
93-
9486
#### Grouping tests
9587

9688
tests/codeception
@@ -114,6 +106,18 @@ Further groups
114106
- @group run-once
115107

116108

109+
110+
111+
### FAQ
112+
113+
#### Functional vs. acceptance tests
114+
115+
Due to limitations functional-testing should only be used for basic tests, see codeception.com
116+
117+
For Login, JavaScript, Cookies, Session, ... use acceptance tests. See commands `wait(1)`, `waitForElement(1)`.
118+
119+
> Note: In Codeception acceptance tests checks are performed *as seen* in the browser, for example you have to check for `MYLINK` if there's a `text-transform: uppercase` or a link `mylink`.
120+
117121
#### Detecting application type
118122

119123
Console vs. Web config
@@ -123,7 +127,3 @@ Console vs. Web config
123127
#### Re-run failed tests
124128

125129
codecept run -g failed
126-
127-
#### e2e (acceptance)
128-
129-
> Note: In Codeception acceptance tests checks are performed *as seen* in the browser, for example you have to check for `MYLINK` if there's a `text-transform: uppercase` or a link `mylink`.

guide/development/troubleshooting.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Troubleshooting
22
===============
33

4-
For more frequently asked questions (FAQ) see [GitHub](https://github.com/phundament/app/issues) and [Stackoverflow](http://stackoverflow.com/questions/tagged/phundament)
4+
For more frequently asked questions (FAQ) see [GitHub](https://github.com/dmstr/docker-phd5-app/issues) and [Stackoverflow](http://stackoverflow.com/questions/tagged/phundament)
55

66
Yii
77
---

guide/tutorials/asset-bundles.md

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
Application Asset Bundle
2+
------------------------
3+
4+
- [[app\assets\AppAsset]]
5+
6+
7+
### Asset bundles
8+
9+
By default *phd* runs with the default bootstrap asset bundle from Yii.
10+
To enable asset customization, edit `src/assets/AppAsset.php` and uncomment `'less/app.less',`.
11+
12+
There are three files included by default:
13+
14+
- `app.less` main LESS file for application
15+
- `bootstrap.less` includes for bootstrap LESS files
16+
- `variables.less` bootstrap settings
17+
18+
Initial adjustment to the style settings of the application should be made in `variables.less`
19+
20+
> When developing assets you can set `APP_ASSET_FORCE_PUBLISH=1` in your local `.env` file, this improves detection of
21+
changes for included files.
22+
> Note: This feature is only available in the `AppAsset` bundle for the application.
23+
24+
For bundling assets for production usage, see tutorial about [asset compression](../6-tutorials/asset-compression.md).
25+

guide/tutorials/asset-compression.md

+9-28
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,23 @@
1+
Assets
2+
======
3+
4+
5+
6+
17
Asset compression
28
-----------------
39

410
phd bundles the assets in the `:development` Docker container, which comes pre-installed with all required
511
tools, to make use of Yii 2.0 Framework asset compresssion.
612

13+
For debugging you can enter a development container
14+
715
docker-compose run --rm php bash
816

9-
Bundle the assets from the container-bash
17+
and bundle the assets from the container-bash
1018

1119
$ mkdir -p web/assets-prod/js web/assets-prod/css
1220
$ yii asset src/config/assets-prod.php src/config/bundle-prod.php
1321

1422
> Note! Make sure not to use a backlash `\` at the beginning of your asset-bundle name, since it may conflict with
1523
> the `className()` which returns values without a starting backslash
16-
17-
18-
Application Asset Bundle
19-
------------------------
20-
21-
- [[app\assets\AppAsset]]
22-
23-
24-
### Asset bundles
25-
26-
By default *phd* runs with the default bootstrap asset bundle from Yii.
27-
To enable asset customization, edit `src/assets/AppAsset.php` and uncomment `'less/app.less',`.
28-
29-
There are three files included by default:
30-
31-
- `app.less` main LESS file for application
32-
- `bootstrap.less` includes for bootstrap LESS files
33-
- `variables.less` bootstrap settings
34-
35-
Initial adjustment to the style settings of the application should be made in `variables.less`
36-
37-
> When developing assets you can set `APP_ASSET_FORCE_PUBLISH=1` in your local `.env` file, this improves detection of
38-
changes for included files.
39-
> Note: This feature is only available in the `AppAsset` bundle for the application.
40-
41-
For bundling assets for production usage, see tutorial about [asset compression](../6-tutorials/asset-compression.md).
42-

guide/tutorials/docker-webserver.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Custom configuration `build/container-files/etc/nginx/conf.d/app.conf`.
77

88
### Customizing startup and webserver configuration
99

10-
You can build your custom container image on top of the [phd 4 Docker container](https://registry.hub.docker.com/u/phundament/app/) ([repository](https://github.com/phundament/docker)).
10+
You can build your custom container image on top of the [phd Docker container](https://registry.hub.docker.com/u/phundament/app/) ([repository](https://github.com/phundament/docker)).
1111
Just use the `FROM` instruction in your `Dockerfile`
1212

1313
FROM phundament/app

guide/tutorials/installation-composer.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Create a new database to store application information.
1616

1717
### Composer installation
1818

19-
You can install _phd 4_ using [composer](https://getcomposer.org/download/)...
19+
You can install _phd_ using [composer](https://getcomposer.org/download/)...
2020

2121
composer global require "fxp/composer-asset-plugin:1.1.*"
2222
composer create-project --stability=beta phundament/app myapp

guide/tutorials/testing-yii2-extensions.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
**Note! This is a concept/prototype.**
44

5-
You can use *[phd 4](https://github.com/phundament/app)* in a docker-stack "wrapped around" the extension directory.
5+
You can use *[the vanilla application image](https://github.com/dmstr/docker-yii2-app)* in a docker-stack "wrapped around" the extension directory.
66

77
The basic concept is to start an application stack with `docker-compose` and "host-mount" the extension directly into `/vendor/name/extension`.
88

99
> You should be able to use this approach for any *Yii 2.0 Framework* extension. Note: You need to install the extension in the application. This is a current limitation.
1010
11-
In `tests/` resides a `docker-compose.yml` file, which contains an full-featured `phundament/app` stack, with pre-installed a *Codeception* test-framework on the `appcli`-container.
11+
In `tests/` resides a `docker-compose.yml` file, which contains an full-featured `phd` stack, with pre-installed a *Codeception* test-framework on the `appcli`-container.
1212
There are suites for CLI, unit, function and acceptance testing right - ready to use, right out of the box.
1313

1414
The stack also contains *Selenium* containers for acceptance testing with screenshots - *Firefox* or *Chrome*.

0 commit comments

Comments
 (0)