Travis support

This commit is contained in:
Ingo Schommer 2013-10-29 12:06:34 +01:00
parent 2d035a6e94
commit 13bb2cf270
3 changed files with 44 additions and 5 deletions

28
.travis.yml Normal file
View File

@ -0,0 +1,28 @@
# See https://github.com/silverstripe-labs/silverstripe-travis-support for setup details
language: php
php:
- 5.3
env:
matrix:
- DB=MYSQL CORE_RELEASE=3.1
matrix:
include:
- php: 5.3
env: DB=PGSQL CORE_RELEASE=3.1
- php: 5.4
env: DB=MYSQL CORE_RELEASE=master
- php: 5.5
env: DB=MYSQL CORE_RELEASE=master
before_script:
- phpenv rehash
- git clone git://github.com/silverstripe-labs/silverstripe-travis-support.git ~/travis-support
- php ~/travis-support/travis_setup.php --source `pwd` --target ~/builds/ss
- cd ~/builds/ss
script:
- phpunit versionfeed/tests/

View File

@ -1,5 +1,7 @@
# Version Feed # Version Feed
[![Build Status](https://secure.travis-ci.org/silverstripe-labs/silverstripe-versionfeed.png)](http://travis-ci.org/silverstripe-labs/silverstripe-versionfeed)
## Overview ## Overview
The module creates an RSS feed on each page with their change history, as well as one for the entire site. The module creates an RSS feed on each page with their change history, as well as one for the entire site.

View File

@ -1,6 +1,17 @@
<?php <?php
class VersionFeedTest extends SapphireTest { class VersionFeedTest extends SapphireTest {
protected $usesDatabase = true;
protected $requiredExtensions = array(
'SiteTree' => array('VersionFeed'),
'ContentController' => array('VersionFeed_Controller'),
);
protected $illegalExtensions = array(
'SiteTree' => array('Translatable')
);
public function testDiffedChangesExcludesRestrictedItems() { public function testDiffedChangesExcludesRestrictedItems() {
$this->markTestIncomplete(); $this->markTestIncomplete();
} }
@ -13,8 +24,6 @@ class VersionFeedTest extends SapphireTest {
$page = new Page(array('Title' => 'My Title')); $page = new Page(array('Title' => 'My Title'));
$page->write(); $page->write();
$page->publish('Stage', 'Live'); $page->publish('Stage', 'Live');
$feed = new VersionFeed();
$feed->setOwner($page);
$page->Title = 'My Changed Title'; $page->Title = 'My Changed Title';
$page->write(); $page->write();
@ -25,13 +34,13 @@ class VersionFeedTest extends SapphireTest {
$this->assertContains( $this->assertContains(
_t('RSSHistory.TITLECHANGED', 'Title has changed:') . 'My Changed Title', _t('RSSHistory.TITLECHANGED', 'Title has changed:') . 'My Changed Title',
array_map('strip_tags', $feed->getDiffedChanges()->column('DiffTitle')), array_map('strip_tags', $page->getDiffedChanges()->column('DiffTitle')),
'Detects published title changes' 'Detects published title changes'
); );
$this->assertNotContains( $this->assertNotContains(
_t('RSSHistory.TITLECHANGED', 'Title has changed:') . 'My Unpublished Changed Title', _t('RSSHistory.TITLECHANGED', 'Title has changed:') . 'My Unpublished Changed Title',
array_map('strip_tags', $feed->getDiffedChanges()->column('DiffTitle')), array_map('strip_tags', $page->getDiffedChanges()->column('DiffTitle')),
'Ignores unpublished title changes' 'Ignores unpublished title changes'
); );
} }