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
php:
- 5.3
- 5.4
php:
- 5.3
env:
- DB=MYSQL CORE_RELEASE=3.1
- DB=PGSQL CORE_RELEASE=3.1
- DB=SQLITE3 CORE_RELEASE=3.1
- DB=MYSQL CORE_RELEASE=3.1
matrix:
exclude:
- php: 5.4
include:
- php: 5.3
env: DB=PGSQL CORE_RELEASE=3.1
- php: 5.3
env: DB=SQLITE CORE_RELEASE=3.1
- php: 5.4
env: DB=SQLITE3 CORE_RELEASE=3.1
allow_failures:
- env: DB=PGSQL CORE_RELEASE=3.1
- env: DB=SQLITE3 CORE_RELEASE=3.1
env: DB=MYSQL CORE_RELEASE=3.1
- php: 5.5
env: DB=MYSQL CORE_RELEASE=3.1
before_script:
- 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.
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,
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

View File

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

View File

@ -41,8 +41,11 @@ class MemberCsvBulkLoaderTest extends SapphireTest {
$results = $loader->load($this->getCurrentRelativePath() . '/MemberCsvBulkLoaderTest.csv');
$created = $results->Created()->toArray();
$this->assertEquals($created[0]->Groups()->column('ID'), array($existinggroup->ID));
$this->assertEquals($created[1]->Groups()->column('ID'), array($existinggroup->ID));
$this->assertEquals(1, count($created[0]->Groups()->column('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() {
@ -55,8 +58,12 @@ class MemberCsvBulkLoaderTest extends SapphireTest {
$this->assertEquals($newgroup->Title, 'newgroup');
$created = $results->Created()->toArray();
$this->assertEquals($created[0]->Groups()->column('ID'), array($existinggroup->ID));
$this->assertEquals($created[1]->Groups()->column('ID'), array($existinggroup->ID, $newgroup->ID));
$this->assertEquals(1, count($created[0]->Groups()->column('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() {