Merge branch '3.0' into 3.1

Conflicts:
	.travis.yml
	control/HTTP.php
	email/Mailer.php
	tests/control/HTTPTest.php
This commit is contained in:
Simon Welsh 2013-07-05 10:17:14 +12:00
commit d844c74e3c
4 changed files with 35 additions and 33 deletions

View File

@ -1,23 +1,21 @@
language: php language: php
php: php:
- 5.3 - 5.3
- 5.4
env: env:
- DB=MYSQL CORE_RELEASE=3.1 - DB=MYSQL CORE_RELEASE=3.1
- DB=PGSQL CORE_RELEASE=3.1
- DB=SQLITE3 CORE_RELEASE=3.1
matrix: matrix:
exclude: include:
- php: 5.4 - php: 5.3
env: DB=PGSQL CORE_RELEASE=3.1 env: DB=PGSQL CORE_RELEASE=3.1
- php: 5.3
env: DB=SQLITE CORE_RELEASE=3.1
- php: 5.4 - php: 5.4
env: DB=SQLITE3 CORE_RELEASE=3.1 env: DB=MYSQL CORE_RELEASE=3.1
allow_failures: - php: 5.5
- env: DB=PGSQL CORE_RELEASE=3.1 env: DB=MYSQL CORE_RELEASE=3.1
- env: DB=SQLITE3 CORE_RELEASE=3.1
before_script: before_script:
- phpenv rehash - phpenv rehash

View File

@ -82,7 +82,7 @@ If you're familiar with it, here's the short version of what you need to know. O
* **Choose the correct branch**: Assume the current release is 3.0.3, and 3.1.0 is in beta state. * **Choose the correct branch**: Assume the current release is 3.0.3, and 3.1.0 is in beta state.
Most pull requests should go against the `3.1.x-dev` *pre-release branch*, only critical bugfixes Most pull requests should go against the `3.1.x-dev` *pre-release branch*, only critical bugfixes
against the `3.0.x-dev` *release branch*. If you're changing an API or introducing a major feature, against the `3.0.x-dev` *release branch*. If you're changing an API or introducing a major feature,
the pull request should go against `master` (read more about our [release process](/misc/release-process)). the pull request should go against `master` (read more about our [release process](/misc/release-process)). Branches are periodically merged "upwards" (3.0 into 3.1, 3.1 into master).
### Editing files directly on GitHub.com ### Editing files directly on GitHub.com

View File

@ -44,12 +44,12 @@ class GroupTest extends FunctionalTest {
$form->saveInto($member); $form->saveInto($member);
$updatedGroups = $member->Groups(); $updatedGroups = $member->Groups();
$this->assertEquals( $this->assertEquals(2, count($updatedGroups->column()),
array($adminGroup->ID, $parentGroup->ID),
$updatedGroups->column(),
"Adding a toplevel group works" "Adding a toplevel group works"
); );
$this->assertContains($adminGroup->ID, $updatedGroups->column('ID'));
$this->assertContains($parentGroup->ID, $updatedGroups->column('ID'));
// Test unsetting relationship // Test unsetting relationship
$form->loadDataFrom($member); $form->loadDataFrom($member);
$checkboxSetField = $form->Fields()->fieldByName('Groups'); $checkboxSetField = $form->Fields()->fieldByName('Groups');
@ -60,11 +60,10 @@ class GroupTest extends FunctionalTest {
$form->saveInto($member); $form->saveInto($member);
$member->flushCache(); $member->flushCache();
$updatedGroups = $member->Groups(); $updatedGroups = $member->Groups();
$this->assertEquals( $this->assertEquals(1, count($updatedGroups->column()),
array($adminGroup->ID),
$updatedGroups->column(),
"Removing a previously added toplevel group works" "Removing a previously added toplevel group works"
); );
$this->assertContains($adminGroup->ID, $updatedGroups->column('ID'));
// Test adding child group // Test adding child group
@ -77,23 +76,21 @@ class GroupTest extends FunctionalTest {
$orphanGroup->ParentID = 99999; $orphanGroup->ParentID = 99999;
$orphanGroup->write(); $orphanGroup->write();
$this->assertEquals( $this->assertEquals(1, count($parentGroup->collateAncestorIDs()),
array($parentGroup->ID),
$parentGroup->collateAncestorIDs(),
'Root node only contains itself' 'Root node only contains itself'
); );
$this->assertContains($parentGroup->ID, $parentGroup->collateAncestorIDs());
$this->assertEquals( $this->assertEquals(2, count($childGroup->collateAncestorIDs()),
array($childGroup->ID, $parentGroup->ID),
$childGroup->collateAncestorIDs(),
'Contains parent nodes, with child node first' 'Contains parent nodes, with child node first'
); );
$this->assertContains($parentGroup->ID, $childGroup->collateAncestorIDs());
$this->assertContains($childGroup->ID, $childGroup->collateAncestorIDs());
$this->assertEquals( $this->assertEquals(1, count($orphanGroup->collateAncestorIDs()),
array($orphanGroup->ID),
$orphanGroup->collateAncestorIDs(),
'Orphaned nodes dont contain invalid parent IDs' 'Orphaned nodes dont contain invalid parent IDs'
); );
$this->assertContains($orphanGroup->ID, $orphanGroup->collateAncestorIDs());
} }
public function testDelete() { public function testDelete() {

View File

@ -41,8 +41,11 @@ class MemberCsvBulkLoaderTest extends SapphireTest {
$results = $loader->load($this->getCurrentRelativePath() . '/MemberCsvBulkLoaderTest.csv'); $results = $loader->load($this->getCurrentRelativePath() . '/MemberCsvBulkLoaderTest.csv');
$created = $results->Created()->toArray(); $created = $results->Created()->toArray();
$this->assertEquals($created[0]->Groups()->column('ID'), array($existinggroup->ID)); $this->assertEquals(1, count($created[0]->Groups()->column('ID')));
$this->assertEquals($created[1]->Groups()->column('ID'), array($existinggroup->ID)); $this->assertContains($existinggroup->ID, $created[0]->Groups()->column('ID'));
$this->assertEquals(1, count($created[1]->Groups()->column('ID')));
$this->assertContains($existinggroup->ID, $created[1]->Groups()->column('ID'));
} }
public function testAddToCsvColumnGroupsByCode() { public function testAddToCsvColumnGroupsByCode() {
@ -55,8 +58,12 @@ class MemberCsvBulkLoaderTest extends SapphireTest {
$this->assertEquals($newgroup->Title, 'newgroup'); $this->assertEquals($newgroup->Title, 'newgroup');
$created = $results->Created()->toArray(); $created = $results->Created()->toArray();
$this->assertEquals($created[0]->Groups()->column('ID'), array($existinggroup->ID)); $this->assertEquals(1, count($created[0]->Groups()->column('ID')));
$this->assertEquals($created[1]->Groups()->column('ID'), array($existinggroup->ID, $newgroup->ID)); $this->assertContains($existinggroup->ID, $created[0]->Groups()->column('ID'));
$this->assertEquals(2, count($created[1]->Groups()->column('ID')));
$this->assertContains($existinggroup->ID, $created[1]->Groups()->column('ID'));
$this->assertContains($newgroup->ID, $created[1]->Groups()->column('ID'));
} }
public function testCleartextPasswordsAreHashedWithDefaultAlgo() { public function testCleartextPasswordsAreHashedWithDefaultAlgo() {