diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..25a6b7c --- /dev/null +++ b/.travis.yml @@ -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/ \ No newline at end of file diff --git a/README.md b/README.md index 91e46a2..d5fe466 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Version Feed +[![Build Status](https://secure.travis-ci.org/silverstripe-labs/silverstripe-versionfeed.png)](http://travis-ci.org/silverstripe-labs/silverstripe-versionfeed) + ## Overview The module creates an RSS feed on each page with their change history, as well as one for the entire site. diff --git a/tests/VersionFeedTest.php b/tests/VersionFeedTest.php index 6b94d80..f7eef8f 100644 --- a/tests/VersionFeedTest.php +++ b/tests/VersionFeedTest.php @@ -1,6 +1,17 @@ array('VersionFeed'), + 'ContentController' => array('VersionFeed_Controller'), + ); + + protected $illegalExtensions = array( + 'SiteTree' => array('Translatable') + ); + public function testDiffedChangesExcludesRestrictedItems() { $this->markTestIncomplete(); } @@ -13,9 +24,7 @@ class VersionFeedTest extends SapphireTest { $page = new Page(array('Title' => 'My Title')); $page->write(); $page->publish('Stage', 'Live'); - $feed = new VersionFeed(); - $feed->setOwner($page); - + $page->Title = 'My Changed Title'; $page->write(); $page->publish('Stage', 'Live'); @@ -25,13 +34,13 @@ class VersionFeedTest extends SapphireTest { $this->assertContains( _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' ); $this->assertNotContains( _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' ); }