/** * Test confirming a team AFTER brackets started * @covers BBTeam::confirm */ public function test_confirm_active() { $this->set_object_with_open_match(); //Reopen so we can add a team $this->assertTrue($this->tournament->reopen()); $this->object->delete(); //Add a new unconfirmed team (unconfirmed is the default status) $this->object =& $this->tournament->team(); $this->object->display_name = 'unconfirmed team'; $this->assertTrue($this->object->unconfirm()); $this->assertSave($this->object->save()); //Restart without the new team $this->assertTrue($this->tournament->start()); //Make 100% sure team unconfirmed remotely $this->AssertTeamValueExternally($this->object, 'status', BinaryBeast::TEAM_STATUS_UNCONFIRMED); //So we have an unconfirmed team in an active tournament - we shouldn't be able to confirm him now $this->assertFalse($this->object->confirm()); }