mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Merge pull request #6089 from open-sausages/pulls/codecoverage
Code coverage via CodeCov.io
This commit is contained in:
commit
5a2e2b7ed5
@ -16,6 +16,7 @@ env:
|
||||
- secure: "SDGv49c2Ee2YBz7dATE3WnHSVSvJiRJ2BVtRasVshdNDNz3NBRzh13C2fDwTGBU1J6PxiQaGTXBy/BGsvbYk2BvdzHVwozkBpHVSaCNdarpCJ5yZZTqKC3mpA1S5353r5tqronwFuMDpftzXnRMfLZGGQ4kYb9hjV55+FPUTFPk=" # Encrypted ARTIFACTS_SECRET
|
||||
|
||||
matrix:
|
||||
fast_finish: true
|
||||
include:
|
||||
- php: 5.5
|
||||
env: DB=MYSQL PHPUNIT_TEST=1
|
||||
@ -34,14 +35,14 @@ matrix:
|
||||
- php: 5.6
|
||||
env: DB=MYSQL CMS_TEST=1 BEHAT_TEST=1
|
||||
- php: 7.0
|
||||
env: DB=MYSQL PDO=1 PHPUNIT_TEST=1
|
||||
env: DB=MYSQL PDO=1 PHPUNIT_COVERAGE_TEST=1
|
||||
allow_failures:
|
||||
- php: 5.6
|
||||
env: DB=MYSQL CMS_TEST=1 PHPUNIT_TEST=1
|
||||
- php: 5.6
|
||||
env: DB=MYSQL CMS_TEST=1 BEHAT_TEST=1
|
||||
- php: 7.0
|
||||
env: DB=MYSQL PDO=1 PHPUNIT_TEST=1
|
||||
env: DB=MYSQL PDO=1 PHPUNIT_COVERAGE_TEST=1
|
||||
|
||||
before_script:
|
||||
- printf "\n" | pecl install imagick
|
||||
@ -67,6 +68,8 @@ script:
|
||||
- "if [ \"$BEHAT_TEST\" = \"1\" ] && [ \"$CMS_TEST\" = \"1\" ]; then vendor/bin/behat @cms --config cms/tests/behat/behat.yml; fi"
|
||||
- "if [ \"$NPM_TEST\" = \"1\" ]; then npm run test; fi"
|
||||
- "if [ \"$NPM_TEST\" = \"1\" ]; then npm run lint; fi"
|
||||
- "if [ \"$PHPUNIT_COVERAGE_TEST\" = \"1\" ] && [ \"$CMS_TEST\" = \"\" ]; then phpdbg -qrr ./vendor/bin/phpunit --coverage-clover=coverage.xml; fi"
|
||||
- "if [ \"$PHPUNIT_COVERAGE_TEST\" = \"1\" ] && [ \"$CMS_TEST\" = \"\" ]; then bash <(curl -s https://codecov.io/bash) -f coverage.xml; fi"
|
||||
|
||||
after_failure:
|
||||
- php ~/travis-support/travis_upload_artifacts.php --if-env BEHAT_TEST,ARTIFACTS_BUCKET,ARTIFACTS_KEY,ARTIFACTS_SECRET --target-path $TRAVIS_REPO_SLUG/$TRAVIS_BUILD_ID/$TRAVIS_JOB_ID --artifacts-base-url https://s3.amazonaws.com/$ARTIFACTS_BUCKET/
|
||||
|
@ -3,6 +3,7 @@
|
||||
[![Build Status](https://api.travis-ci.org/silverstripe/silverstripe-framework.svg?branch=master)](https://travis-ci.org/silverstripe/silverstripe-framework)
|
||||
[![Latest Stable Version](https://poser.pugx.org/silverstripe/framework/version.svg)](http://www.silverstripe.org/stable-download/)
|
||||
[![Latest Unstable Version](https://poser.pugx.org/silverstripe/framework/v/unstable.svg)](https://packagist.org/packages/silverstripe/framework)
|
||||
[![codecov](https://codecov.io/gh/silverstripe/silverstripe-framework/branch/master/graph/badge.svg)](https://codecov.io/gh/silverstripe/silverstripe-framework)
|
||||
[![Total Downloads](https://poser.pugx.org/silverstripe/framework/downloads.svg)](https://packagist.org/packages/silverstripe/framework)
|
||||
[![License](https://poser.pugx.org/silverstripe/framework/license.svg)](https://github.com/silverstripe/silverstripe-framework#license)
|
||||
[![Dependency Status](https://www.versioneye.com/php/silverstripe:framework/badge.svg)](https://www.versioneye.com/php/silverstripe:framework)
|
||||
|
@ -32,4 +32,17 @@
|
||||
<group>sanitychecks</group>
|
||||
</exclude>
|
||||
</groups>
|
||||
|
||||
<filter>
|
||||
<whitelist addUncoveredFilesFromWhitelist="true">
|
||||
<directory suffix=".php">.</directory>
|
||||
<exclude>
|
||||
<directory suffix=".php">thirdparty/</directory>
|
||||
<directory suffix=".php">admin/thirdparty/</directory>
|
||||
<directory suffix=".php">tests/</directory>
|
||||
<directory suffix=".php">admin/tests/</directory>
|
||||
</exclude>
|
||||
</whitelist>
|
||||
</filter>
|
||||
|
||||
</phpunit>
|
||||
|
@ -294,7 +294,7 @@ class ControllerTest extends FunctionalTest {
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Controller::hasAction
|
||||
* @covers SilverStripe\Control\Controller::hasAction
|
||||
*/
|
||||
public function testHasAction() {
|
||||
$controller = new ControllerTest_HasAction();
|
||||
|
@ -424,7 +424,7 @@ class DirectorTest extends SapphireTest {
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Director::extract_request_headers()
|
||||
* @covers SilverStripe\Control\Director::extract_request_headers()
|
||||
*/
|
||||
public function testExtractRequestHeaders() {
|
||||
$request = array(
|
||||
|
@ -92,7 +92,7 @@ class ClassInfoTest extends SapphireTest {
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers ClassInfo::ancestry()
|
||||
* @covers SilverStripe\Core\ClassInfo::ancestry()
|
||||
*/
|
||||
public function testAncestry() {
|
||||
$ancestry = ClassInfo::ancestry('ClassInfoTest_ChildClass');
|
||||
@ -119,7 +119,7 @@ class ClassInfoTest extends SapphireTest {
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers ClassInfo::dataClassesFor()
|
||||
* @covers SilverStripe\Core\ClassInfo::dataClassesFor()
|
||||
*/
|
||||
public function testDataClassesFor() {
|
||||
$expect = array(
|
||||
|
@ -33,7 +33,7 @@ use SilverStripe\Forms\GridField\GridField_HTMLProvider;
|
||||
class GridFieldTest extends SapphireTest {
|
||||
|
||||
/**
|
||||
* @covers GridField::__construct
|
||||
* @covers SilverStripe\Forms\GridField\GridField::__construct
|
||||
*/
|
||||
public function testGridField() {
|
||||
$obj = new GridField('testfield', 'testfield');
|
||||
@ -41,8 +41,8 @@ class GridFieldTest extends SapphireTest {
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers GridField::__construct
|
||||
* @covers GridField::getList
|
||||
* @covers SilverStripe\Forms\GridField\GridField::__construct
|
||||
* @covers SilverStripe\Forms\GridField\GridField::getList
|
||||
*/
|
||||
public function testGridFieldSetList() {
|
||||
$list = ArrayList::create(array(1=>'hello', 2=>'goodbye'));
|
||||
@ -51,10 +51,10 @@ class GridFieldTest extends SapphireTest {
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers GridField::__construct
|
||||
* @covers GridField::getConfig
|
||||
* @covers GridFieldConfig_Base::__construct
|
||||
* @covers GridFieldConfig::addComponent
|
||||
* @covers SilverStripe\Forms\GridField\GridField::__construct
|
||||
* @covers SilverStripe\Forms\GridField\GridField::getConfig
|
||||
* @covers SilverStripe\Forms\GridField\GridFieldConfig_Base::__construct
|
||||
* @covers SilverStripe\Forms\GridField\GridFieldConfig::addComponent
|
||||
*/
|
||||
public function testGridFieldDefaultConfig() {
|
||||
$obj = new GridField('testfield', 'testfield');
|
||||
@ -76,8 +76,8 @@ class GridFieldTest extends SapphireTest {
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers GridFieldConfig::__construct
|
||||
* @covers GridFieldConfig::addComponent
|
||||
* @covers SilverStripe\Forms\GridField\GridFieldConfig::__construct
|
||||
* @covers SilverStripe\Forms\GridField\GridFieldConfig::addComponent
|
||||
*/
|
||||
public function testGridFieldSetCustomConfig() {
|
||||
|
||||
@ -97,8 +97,8 @@ class GridFieldTest extends SapphireTest {
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers GridField::getModelClass
|
||||
* @covers GridField::setModelClass
|
||||
* @covers SilverStripe\Forms\GridField\GridField::getModelClass
|
||||
* @covers SilverStripe\Forms\GridField\GridField::setModelClass
|
||||
*/
|
||||
public function testGridFieldModelClass() {
|
||||
$obj = new GridField('testfield', 'testfield', Member::get());
|
||||
@ -108,7 +108,7 @@ class GridFieldTest extends SapphireTest {
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers GridField::getModelClass
|
||||
* @covers SilverStripe\Forms\GridField\GridField::getModelClass
|
||||
*/
|
||||
public function testGridFieldModelClassThrowsException() {
|
||||
$this->setExpectedException('LogicException');
|
||||
@ -117,8 +117,8 @@ class GridFieldTest extends SapphireTest {
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers GridField::setList
|
||||
* @covers GridField::getList
|
||||
* @covers SilverStripe\Forms\GridField\GridField::setList
|
||||
* @covers SilverStripe\Forms\GridField\GridField::getList
|
||||
*/
|
||||
public function testSetAndGetList() {
|
||||
$list = Member::get();
|
||||
@ -130,7 +130,7 @@ class GridFieldTest extends SapphireTest {
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers GridField::getState
|
||||
* @covers SilverStripe\Forms\GridField\GridField::getState
|
||||
*/
|
||||
public function testGetState() {
|
||||
$obj = new GridField('testfield', 'testfield');
|
||||
@ -141,9 +141,9 @@ class GridFieldTest extends SapphireTest {
|
||||
/**
|
||||
* Tests usage of nested GridState values
|
||||
*
|
||||
* @covers GridState_Data::__get
|
||||
* @covers GridState_Data::__call
|
||||
* @covers GridState_Data::getData
|
||||
* @covers SilverStripe\Forms\GridField\GridState_Data::__get
|
||||
* @covers SilverStripe\Forms\GridField\GridState_Data::__call
|
||||
* @covers SilverStripe\Forms\GridField\GridState_Data::getData
|
||||
*/
|
||||
public function testGetStateData() {
|
||||
$obj = new GridField('testfield', 'testfield');
|
||||
@ -189,7 +189,7 @@ class GridFieldTest extends SapphireTest {
|
||||
|
||||
/**
|
||||
* @skipUpgrade
|
||||
* @covers GridField::getColumns
|
||||
* @covers SilverStripe\Forms\GridField\GridField::getColumns
|
||||
*/
|
||||
public function testGetColumns(){
|
||||
$obj = new GridField('testfield', 'testfield', Member::get());
|
||||
@ -202,7 +202,7 @@ class GridFieldTest extends SapphireTest {
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers GridField::getColumnCount
|
||||
* @covers SilverStripe\Forms\GridField\GridField::getColumnCount
|
||||
*/
|
||||
public function testGetColumnCount() {
|
||||
$obj = new GridField('testfield', 'testfield', Member::get());
|
||||
@ -211,7 +211,7 @@ class GridFieldTest extends SapphireTest {
|
||||
|
||||
/**
|
||||
* @skipUpgrade
|
||||
* @covers GridField::getColumnContent
|
||||
* @covers SilverStripe\Forms\GridField\GridField::getColumnContent
|
||||
*/
|
||||
public function testGetColumnContent() {
|
||||
$list = new ArrayList(array(
|
||||
@ -223,7 +223,7 @@ class GridFieldTest extends SapphireTest {
|
||||
|
||||
/**
|
||||
* @skipUpgrade
|
||||
* @covers GridField::getColumnContent
|
||||
* @covers SilverStripe\Forms\GridField\GridField::getColumnContent
|
||||
*/
|
||||
public function testGetColumnContentBadArguments() {
|
||||
$this->setExpectedException('InvalidArgumentException');
|
||||
@ -236,7 +236,7 @@ class GridFieldTest extends SapphireTest {
|
||||
|
||||
/**
|
||||
* @skipUpgrade
|
||||
* @covers GridField::getColumnAttributes
|
||||
* @covers SilverStripe\Forms\GridField\GridField::getColumnAttributes
|
||||
*/
|
||||
public function testGetColumnAttributesEmptyArray() {
|
||||
$list = new ArrayList(array(
|
||||
@ -248,7 +248,7 @@ class GridFieldTest extends SapphireTest {
|
||||
|
||||
/**
|
||||
* @skipUpgrade
|
||||
* @covers GridField::getColumnAttributes
|
||||
* @covers SilverStripe\Forms\GridField\GridField::getColumnAttributes
|
||||
*/
|
||||
public function testGetColumnAttributes() {
|
||||
$list = new ArrayList(array(
|
||||
@ -260,7 +260,7 @@ class GridFieldTest extends SapphireTest {
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers GridField::getColumnAttributes
|
||||
* @covers SilverStripe\Forms\GridField\GridField::getColumnAttributes
|
||||
*/
|
||||
public function testGetColumnAttributesBadArguments() {
|
||||
$this->setExpectedException('InvalidArgumentException');
|
||||
@ -284,7 +284,7 @@ class GridFieldTest extends SapphireTest {
|
||||
|
||||
/**
|
||||
* @skipUpgrade
|
||||
* @covers GridField::getColumnMetadata
|
||||
* @covers SilverStripe\Forms\GridField\GridField::getColumnMetadata
|
||||
*/
|
||||
public function testGetColumnMetadata() {
|
||||
$list = new ArrayList(array(
|
||||
@ -296,7 +296,7 @@ class GridFieldTest extends SapphireTest {
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers GridField::getColumnMetadata
|
||||
* @covers SilverStripe\Forms\GridField\GridField::getColumnMetadata
|
||||
*/
|
||||
public function testGetColumnMetadataBadResponseFromComponent() {
|
||||
$this->setExpectedException('LogicException');
|
||||
@ -309,7 +309,7 @@ class GridFieldTest extends SapphireTest {
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers GridField::getColumnMetadata
|
||||
* @covers SilverStripe\Forms\GridField\GridField::getColumnMetadata
|
||||
*/
|
||||
public function testGetColumnMetadataBadArguments() {
|
||||
$this->setExpectedException('InvalidArgumentException');
|
||||
@ -320,7 +320,7 @@ class GridFieldTest extends SapphireTest {
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers GridField::handleAction
|
||||
* @covers SilverStripe\Forms\GridField\GridField::handleAction
|
||||
*/
|
||||
public function testHandleActionBadArgument() {
|
||||
$this->setExpectedException('InvalidArgumentException');
|
||||
@ -329,7 +329,7 @@ class GridFieldTest extends SapphireTest {
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers GridField::handleAction
|
||||
* @covers SilverStripe\Forms\GridField\GridField::handleAction
|
||||
*/
|
||||
public function testHandleAction() {
|
||||
$config = GridFieldConfig::create()->addComponent(new GridFieldTest_Component);
|
||||
@ -338,7 +338,7 @@ class GridFieldTest extends SapphireTest {
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers GridField::getCastedValue
|
||||
* @covers SilverStripe\Forms\GridField\GridField::getCastedValue
|
||||
*/
|
||||
public function testGetCastedValue() {
|
||||
$obj = new GridField('testfield', 'testfield');
|
||||
@ -347,7 +347,7 @@ class GridFieldTest extends SapphireTest {
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers GridField::getCastedValue
|
||||
* @covers SilverStripe\Forms\GridField\GridField::getCastedValue
|
||||
*/
|
||||
public function testGetCastedValueObject() {
|
||||
$obj = new GridField('testfield', 'testfield');
|
||||
@ -356,7 +356,7 @@ class GridFieldTest extends SapphireTest {
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers GridField::gridFieldAlterAction
|
||||
* @covers SilverStripe\Forms\GridField\GridField::gridFieldAlterAction
|
||||
*/
|
||||
public function testGridFieldAlterAction() {
|
||||
$this->markTestIncomplete();
|
||||
@ -456,7 +456,7 @@ class GridFieldTest extends SapphireTest {
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers GridField::FieldHolder
|
||||
* @covers SilverStripe\Forms\GridField\GridField::FieldHolder
|
||||
*/
|
||||
public function testCanViewOnlyOddIDs() {
|
||||
$this->logInWithPermission();
|
||||
|
@ -8,7 +8,7 @@ use SilverStripe\Forms\GridField\GridField;
|
||||
class GridFieldDataColumnsTest extends SapphireTest {
|
||||
|
||||
/**
|
||||
* @covers GridFieldDataColumns::getDisplayFields
|
||||
* @covers SilverStripe\Forms\GridField\GridFieldDataColumns::getDisplayFields
|
||||
*/
|
||||
public function testGridFieldGetDefaultDisplayFields() {
|
||||
$obj = new GridField('testfield', 'testfield', Member::get());
|
||||
@ -18,8 +18,8 @@ class GridFieldDataColumnsTest extends SapphireTest {
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers GridFieldDataColumns::setDisplayFields
|
||||
* @covers GridFieldDataColumns::getDisplayFields
|
||||
* @covers SilverStripe\Forms\GridField\GridFieldDataColumns::setDisplayFields
|
||||
* @covers SilverStripe\Forms\GridField\GridFieldDataColumns::getDisplayFields
|
||||
*/
|
||||
public function testGridFieldCustomDisplayFields() {
|
||||
$obj = new GridField('testfield', 'testfield', Member::get());
|
||||
@ -31,8 +31,8 @@ class GridFieldDataColumnsTest extends SapphireTest {
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers GridFieldDataColumns::setDisplayFields
|
||||
* @covers GridFieldDataColumns::getDisplayFields
|
||||
* @covers SilverStripe\Forms\GridField\GridFieldDataColumns::setDisplayFields
|
||||
* @covers SilverStripe\Forms\GridField\GridFieldDataColumns::getDisplayFields
|
||||
*/
|
||||
public function testGridFieldDisplayFieldsWithBadArguments() {
|
||||
$this->setExpectedException('InvalidArgumentException');
|
||||
@ -42,8 +42,8 @@ class GridFieldDataColumnsTest extends SapphireTest {
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers GridFieldDataColumns::getFieldCasting
|
||||
* @covers GridFieldDataColumns::setFieldCasting
|
||||
* @covers SilverStripe\Forms\GridField\GridFieldDataColumns::getFieldCasting
|
||||
* @covers SilverStripe\Forms\GridField\GridFieldDataColumns::setFieldCasting
|
||||
*/
|
||||
public function testFieldCasting() {
|
||||
$obj = new GridField('testfield', 'testfield');
|
||||
@ -54,8 +54,8 @@ class GridFieldDataColumnsTest extends SapphireTest {
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers GridFieldDataColumns::getFieldFormatting
|
||||
* @covers GridFieldDataColumns::setFieldFormatting
|
||||
* @covers SilverStripe\Forms\GridField\GridFieldDataColumns::getFieldFormatting
|
||||
* @covers SilverStripe\Forms\GridField\GridFieldDataColumns::setFieldFormatting
|
||||
*/
|
||||
public function testFieldFormatting() {
|
||||
$obj = new GridField('testfield', 'testfield');
|
||||
|
@ -17,7 +17,7 @@ use SilverStripe\Dev\TestOnly;
|
||||
class DBStringTest extends SapphireTest {
|
||||
|
||||
/**
|
||||
* @covers SilverStripe\Model\FieldType\DBField::forTemplate()
|
||||
* @covers SilverStripe\ORM\FieldType\DBField::forTemplate()
|
||||
*/
|
||||
public function testForTemplate() {
|
||||
$this->assertEquals(
|
||||
@ -39,7 +39,7 @@ class DBStringTest extends SapphireTest {
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers SilverStripe\Model\FieldType\DBString::LowerCase()
|
||||
* @covers SilverStripe\ORM\FieldType\DBString::LowerCase()
|
||||
*/
|
||||
public function testLowerCase() {
|
||||
$this->assertEquals(
|
||||
@ -49,7 +49,7 @@ class DBStringTest extends SapphireTest {
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers SilverStripe\Model\FieldType\DBString::UpperCase()
|
||||
* @covers SilverStripe\ORM\FieldType\DBString::UpperCase()
|
||||
*/
|
||||
public function testUpperCase() {
|
||||
$this->assertEquals(
|
||||
|
@ -297,7 +297,7 @@ class DataObjectSchemaTest extends SapphireTest
|
||||
|
||||
|
||||
/**
|
||||
* @covers DataObjectSchema::baseDataClass()
|
||||
* @covers SilverStripe\ORM\DataObjectSchema::baseDataClass()
|
||||
*/
|
||||
public function testBaseDataClass() {
|
||||
$schema = DataObject::getSchema();
|
||||
|
@ -191,7 +191,7 @@ class HierarchyTest extends SapphireTest {
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Hierarchy::markChildren()
|
||||
* @covers SilverStripe\ORM\Hierarchy\Hierarchy::markChildren()
|
||||
*/
|
||||
public function testMarkChildrenDoesntUnmarkPreviouslyMarked() {
|
||||
$obj3 = $this->objFromFixture('HierarchyTest_Object', 'obj3');
|
||||
|
@ -1166,7 +1166,7 @@ after')
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers SSViewer::get_templates_by_class()
|
||||
* @covers SilverStripe\View\SSViewer::get_templates_by_class()
|
||||
*/
|
||||
public function testGetTemplatesByClass() {
|
||||
$self = $this;
|
||||
|
Loading…
x
Reference in New Issue
Block a user