Skip to content

Commit

Permalink
DevKit updates (#237)
Browse files Browse the repository at this point in the history
* DevKit updates and test calling improvements

* DevKit updates

* DevKit updates

* DevKit updates

* follow up on dev kit changes (#238)

changes due to style hints

revert min-stab

Revert "changes due to style hints"

This reverts commit 3fc2442

changes due to style hints
  • Loading branch information
ElectricMaxxx committed Oct 20, 2017
1 parent e8a5cce commit 3129a42
Show file tree
Hide file tree
Showing 14 changed files with 229 additions and 41 deletions.
23 changes: 23 additions & 0 deletions .editorconfig
@@ -0,0 +1,23 @@
root = true

[*]
end_of_line = lf
indent_style = space
charset = utf-8
insert_final_newline = true
trim_trailing_whitespace = true

[*.{yml,twig,php}]
indent_size = 4

[*.{js,json,scss,css}]
indent_size = 2

[.travis.yml]
indent_size = 2

[composer.json]
indent_size = 4

[Makefile]
indent_style = tab
3 changes: 3 additions & 0 deletions .gitattributes
@@ -0,0 +1,3 @@
.* export-ignore
*.md export-ignore
Tests/* export-ignore
43 changes: 43 additions & 0 deletions .github/ISSUE_TEMPLATE.md
@@ -0,0 +1,43 @@
<!--
Before you open an issue, make sure this one does not already exist.
Please also read the "guidelines for contributing" link above before posting.
-->

<!--
If you are reporting a bug, please try to fill in the following.
Otherwise remove it.
-->

### Environment

#### Symfony packages

```
$ composer show --latest 'symfony/*'
```

#### Symfony CMF packages

```
$ composer show --latest 'symfony-cmf/*'
```

## Subject

<!--
Give here as many details as possible.
Next sections are for ERRORS only.
-->

## Steps to reproduce

## Expected results

## Actual results

<!--
If it's an error message or piece of code, use code block tags,
and make sure you provide the whole stack trace(s),
not just the first error message you can see.
More details here: https://github.com/symfony-cmf/core-bundle/blob/master/CONTRIBUTING.md#issues
-->
10 changes: 10 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,10 @@
| Q | A
| ------------- | ---
| Branch? | "master" for new features / the branch of the current release for fixes
| Bug fix? | yes/no
| New feature? | yes/no
| BC breaks? | yes/no
| Deprecations? | yes/no
| Fixed tickets | comma-separated list of tickets fixed by the PR, if any
| License | MIT
| Doc PR | reference to the documentation PR, if any
26 changes: 24 additions & 2 deletions .styleci.yml
@@ -1,7 +1,29 @@
#######################################################
# DO NOT EDIT THIS FILE! #
# #
# It's auto-generated by symfony-cmf/dev-kit package. #
#######################################################

############################################################################
# This file is part of the Symfony CMF package. #
# #
# (c) 2011-2017 Symfony CMF #
# #
# For the full copyright and license information, please view the LICENSE #
# file that was distributed with this source code. #
############################################################################


preset: symfony

enabled:
- ordered_use
- combine_consecutive_unsets
- short_array_syntax

- newline_after_open_tag
- no_php4_constructor
- no_useless_else
- ordered_use
- strict
- php_unit_construct

disabled: [single_line_class_definition]
52 changes: 40 additions & 12 deletions .travis.yml
@@ -1,7 +1,22 @@
#######################################################
# DO NOT EDIT THIS FILE! #
# #
# It's auto-generated by symfony-cmf/dev-kit package. #
#######################################################

############################################################################
# This file is part of the Symfony CMF package. #
# #
# (c) 2011-2017 Symfony CMF #
# #
# For the full copyright and license information, please view the LICENSE #
# file that was distributed with this source code. #
############################################################################

language: php

php:
- 7.0
- 7.1

sudo: false

Expand All @@ -11,34 +26,47 @@ cache:
- $HOME/.composer/cache/files

env:
matrix: SYMFONY_VERSION=3.2.*
matrix: SYMFONY_VERSION=3.4
global:
- SYMFONY_DEPRECATIONS_HELPER=42
- SYMFONY_PHPUNIT_DIR=.phpunit SYMFONY_PHPUNIT_REMOVE="symfony/yaml"
- SYMFONY_PHPUNIT_VERSION=5.7
- SYMFONY_DEPRECATIONS_HELPER=48
- SYMFONY_PHPUNIT_DIR=.phpunit SYMFONY_PHPUNIT_REMOVE="symfony/yaml" SYMFONY_PHPUNIT_VERSION=5.7
- TEST_INSTALLATION=false

matrix:
include:
- php: 5.6
env: COMPOSER_FLAGS="--prefer-lowest" SYMFONY_VERSION=2.8.* SYMFONY_DEPRECATIONS_HELPER=weak
- php: 7.1
env: DEPS=dev SYMFONY_VERSION=3.3.*
env: SYMFONY_VERSION=3.4.*
- php: 7.1
env: DEPS=dev SYMFONY_VERSION=3.3.*
- php: 5.6
env: COMPOSER_FLAGS="--prefer-lowest" SYMFONY_VERSION=2.8.* SYMFONY_DEPRECATIONS_HELPER=weak
- php: 7.0
env: SYMFONY_VERSION=3.1.*
- php: hhvm
dist: trusty
- php: 7.0
env: SYMFONY_VERSION=3.2.*

- env: TEST_INSTALLATION=true
fast_finish: true
allow_failures:
- php: 7.1
env: SYMFONY_VERSION=3.4.*
- env: TEST_INSTALLATION=true


before_install:
- if [[ "$TRAVIS_PHP_VERSION" != "hhvm" ]]; then echo "memory_limit = -1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini; fi
- phpenv config-rm xdebug.ini || true
- composer self-update
- if [ "$DEPS" = "dev" ]; then perl -pi -e 's/^}$/,"minimum-stability":"dev"}/' composer.json; fi
- if [ "$SYMFONY_VERSION" != "" ]; then composer require symfony/symfony:${SYMFONY_VERSION} --no-update; fi
- export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo $TRAVIS_PULL_REQUEST_BRANCH; fi)

install: travis_wait composer update --prefer-dist $COMPOSER_FLAGS

install: composer update --prefer-dist $COMPOSER_FLAGS
before_script: vendor/symfony-cmf/testing/bin/travis/phpcr_odm_doctrine_dbal.sh

script: vendor/bin/simple-phpunit
script:
- if [ "${TEST_INSTALLATION}" == true ]; then make test_installation; else make test; fi

notifications:
irc: "irc.freenode.org#symfony-cmf"
34 changes: 34 additions & 0 deletions Makefile
@@ -0,0 +1,34 @@
#######################################################
# DO NOT EDIT THIS FILE! #
# #
# It's auto-generated by symfony-cmf/dev-kit package. #
#######################################################

############################################################################
# This file is part of the Symfony CMF package. #
# #
# (c) 2011-2017 Symfony CMF #
# #
# For the full copyright and license information, please view the LICENSE #
# file that was distributed with this source code. #
############################################################################

TESTING_SCRIPTS_DIR=vendor/symfony-cmf/testing/bin
CONSOLE=${TESTING_SCRIPTS_DIR}/console
VERSION=dev-master
ifdef BRANCH
VERSION=dev-${BRANCH}
endif
PACKAGE=symfony-cmf/core-bundle

list:
@echo 'test: will run all tests'
@echo 'unit_tests: will run unit tests only'
@echo 'functional_tests_phpcr: will run functional tests with PHPCR'

@echo 'test_installation: will run installation test'
include ${TESTING_SCRIPTS_DIR}/make/unit_tests.mk
include ${TESTING_SCRIPTS_DIR}/make/functional_tests_phpcr.mk
include ${TESTING_SCRIPTS_DIR}/make/test_installation.mk

test: unit_tests functional_tests_phpcr
53 changes: 41 additions & 12 deletions README.md
@@ -1,35 +1,46 @@
# Symfony CMF Core Bundle

[![Build Status](https://travis-ci.org/symfony-cmf/core-bundle.svg?branch=master)](https://travis-ci.org/symfony-cmf/core-bundle)
[![StyleCI](https://styleci.io/repos/1443095/shield)](https://styleci.io/repos/1443095)
[![Latest Stable Version](https://poser.pugx.org/symfony-cmf/core-bundle/version.png)](https://packagist.org/packages/symfony-cmf/core-bundle)
[![Total Downloads](https://poser.pugx.org/symfony-cmf/core-bundle/d/total.png)](https://packagist.org/packages/symfony-cmf/core-bundle)
[![Latest Stable Version](https://poser.pugx.org/symfony-cmf/core-bundle/v/stable)](https://packagist.org/packages/symfony-cmf/core-bundle)
[![Latest Unstable Version](https://poser.pugx.org/symfony-cmf/core-bundle/v/unstable)](https://packagist.org/packages/symfony-cmf/core-bundle)
[![License](https://poser.pugx.org/symfony-cmf/core-bundle/license)](https://packagist.org/packages/symfony-cmf/core-bundle)

This bundle is part of the [Symfony Content Management Framework (CMF)](http://cmf.symfony.com/)
and licensed under the [MIT License](LICENSE).
[![Total Downloads](https://poser.pugx.org/symfony-cmf/core-bundle/downloads)](https://packagist.org/packages/symfony-cmf/core-bundle)
[![Monthly Downloads](https://poser.pugx.org/symfony-cmf/core-bundle/d/monthly)](https://packagist.org/packages/symfony-cmf/core-bundle)
[![Daily Downloads](https://poser.pugx.org/symfony-cmf/core-bundle/d/daily)](https://packagist.org/packages/symfony-cmf/core-bundle)

Branch | Travis | Coveralls |
------ | ------ | --------- |
master | [![Build Status][travis_stable_badge]][travis_stable_link] | [![Coverage Status][coveralls_stable_badge]][coveralls_stable_link] |
master | [![Build Status][travis_unstable_badge]][travis_unstable_link] | [![Coverage Status][coveralls_unstable_badge]][coveralls_unstable_link] |

This bundle is part of the [Symfony Content Management Framework (CMF)](http://cmf.symfony.com/) and licensed
under the [MIT License](LICENSE).

The CoreBundle for the Symfony content management framework provides common functionality,
helpers and utilities for the other CMF bundles. The major features are a publish workflow,
a twig extension and php templating helper to walk PHPCR-ODM trees and support for optional
translated content.
a twig extension and php templating helper to walk PHPCR-ODM trees and support for optional translated content.


## Requirements

* PHP 5.6 / 7
* Symfony 2.8 / 3
* PHP 5.6 / 7.0 / 7.1
* Symfony 2.8 / 3.1 / 3.2 / 3.3
* See also the `require` section of [composer.json](composer.json)

## Documentation

For the install guide and reference, see:

* [CoreBundle documentation](http://symfony.com/doc/master/cmf/bundles/core/index.html)
* [symfony-cmf/core-bundle Documentation](http://symfony.com/doc/master/cmf/bundles/core/index.html)

See also:

* [All Symfony CMF documentation](http://symfony.com/doc/master/cmf/index.html) - complete Symfony CMF reference
* [Symfony CMF Website](http://cmf.symfony.com/) - introduction, live demo, support and community links

## Support

For general support and questions, please use [StackOverflow](http://stackoverflow.com/questions/tagged/symfony-cmf).

## Contributing

Expand All @@ -42,4 +53,22 @@ Unit and/or functional tests exist for this bundle. See the
for a guide to running the tests.

Thanks to
[everyone who has contributed](https://github.com/symfony-cmf/CoreBundle/contributors) already.
[everyone who has contributed](contributors) already.

## License

This package is available under the [MIT license](src/Resources/meta/LICENSE).

[travis_legacy_badge]: https://travis-ci.org/symfony-cmf/core-bundle.svg?branch=master
[travis_legacy_link]: https://travis-ci.org/symfony-cmf/core-bundle
[travis_stable_badge]: https://travis-ci.org/symfony-cmf/core-bundle.svg?branch=master
[travis_stable_link]: https://travis-ci.org/symfony-cmf/core-bundle
[travis_unstable_badge]: https://travis-ci.org/symfony-cmf/core-bundle.svg?branch=master
[travis_unstable_link]: https://travis-ci.org/symfony-cmf/core-bundle

[coveralls_legacy_badge]: https://coveralls.io/repos/github/symfony-cmf/core-bundle/badge.svg?branch=master
[coveralls_legacy_link]: https://coveralls.io/github/symfony-cmf/core-bundle?branch=master
[coveralls_stable_badge]: https://coveralls.io/repos/github/symfony-cmf/core-bundle/badge.svg?branch=master
[coveralls_stable_link]: https://coveralls.io/github/symfony-cmf/core-bundle?branch=master
[coveralls_unstable_badge]: https://coveralls.io/repos/github/symfony-cmf/core-bundle/badge.svg?branch=master
[coveralls_unstable_link]: https://coveralls.io/github/symfony-cmf/core-bundle?branch=master
6 changes: 3 additions & 3 deletions composer.json
Expand Up @@ -20,11 +20,10 @@
"symfony/phpunit-bridge": "^3.2",
"mockery/mockery": "^0.9.4",
"symfony-cmf/routing-bundle": "^2.0",
"symfony-cmf/testing": "^2.0",
"symfony-cmf/testing": "^2.1@dev",
"doctrine/dbal": "2.5.*",
"doctrine/phpcr-odm": "^1.0"
},
"prefer-stable": true,
"suggest": {
"symfony/twig-bundle": "To get access to the CMF twig extension (^2.1)",
"doctrine/phpcr-bundle": "To be able to use the CMF twig extension (^1.0)",
Expand All @@ -48,5 +47,6 @@
"branch-alias": {
"dev-master": "2.1-dev"
}
}
},
"prefer-stable": true
}
8 changes: 2 additions & 6 deletions phpunit.xml.dist
Expand Up @@ -7,11 +7,11 @@
>

<testsuites>
<testsuite name="Symfony CoreBundle Test Suite">
<testsuite name="unit tests">
<directory>./tests/Unit</directory>
</testsuite>

<testsuite name="phpcr">
<testsuite name="functional tests with phpcr">
<directory>./tests/Functional</directory>
</testsuite>
</testsuites>
Expand All @@ -30,8 +30,4 @@
<server name="KERNEL_DIR" value="tests/Resources/app" />
</php>

<listeners>
<listener class="Symfony\Cmf\Component\Testing\Phpunit\DatabaseTestListener" />
</listeners>

</phpunit>
2 changes: 1 addition & 1 deletion src/Resources/meta/LICENSE
@@ -1,4 +1,4 @@
CoreBundle
Symfony Cmf Core Bundle

The MIT License

Expand Down
2 changes: 1 addition & 1 deletion src/Templating/Helper/CmfHelper.php
Expand Up @@ -204,7 +204,7 @@ private function getDocument($document, $ignoreRole = false, $class = null)
if (empty($document)
|| (false === $ignoreRole && !$this->publishWorkflowChecker->isGranted(PublishWorkflowChecker::VIEW_ATTRIBUTE, $document))
|| (true === $ignoreRole && !$this->publishWorkflowChecker->isGranted(PublishWorkflowChecker::VIEW_ANONYMOUS_ATTRIBUTE, $document))
|| (null != $class && !($document instanceof $class))
|| (null !== $class && !($document instanceof $class))
) {
return;
}
Expand Down
6 changes: 3 additions & 3 deletions tests/Functional/Form/CheckboxUrlLabelFormTypeTest.php
Expand Up @@ -72,13 +72,13 @@ protected function assertMatchesXpath($html, $expression, $count = 1)
$xpath = new \DOMXPath($dom);
$nodeList = $xpath->evaluate('/root'.$expression);

if ($nodeList->length != $count) {
if ($nodeList->length !== $count) {
$dom->formatOutput = true;
$this->fail(sprintf(
"Failed asserting that \n\n%s\n\nmatches exactly %s. Matches %s in \n\n%s",
$expression,
$count == 1 ? 'once' : $count.' times',
$nodeList->length == 1 ? 'once' : $nodeList->length.' times',
$count === 1 ? 'once' : $count.' times',
$nodeList->length === 1 ? 'once' : $nodeList->length.' times',
// strip away <root> and </root>
substr($dom->saveHTML(), 6, -8)
));
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Templating/Helper/CmfHelperTest.php
Expand Up @@ -73,7 +73,7 @@ public function testGetNodeName()
->will($this->returnValue('/foo/bar'))
;

$this->assertEquals(false, $this->extension->getNodeName($document));
$this->assertFalse($this->extension->getNodeName($document));
$this->assertEquals('bar', $this->extension->getNodeName($document));
}

Expand Down

0 comments on commit 3129a42

Please sign in to comment.