1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

Merge branch 'develop-ascraeus' into develop

* develop-ascraeus:
  [ticket/12730] Update Google+ button class to use proper identification
  [ticket/12730] Update maxlen for type_googleplus to 255
  [ticket/12730] Fix type_googleplus_test to use same validation rule as the field
  [ticket/12730] Update field_length to be 20 by default for Google+
  [ticket/12730] Google+ field_order should be 13
  [ticket/12730] Switch service name to googleplus for type_googleplus
  [ticket/12730] Restore field_length to 10 for type_googleplus
  [ticket/12730] Add functional test for Google+ field
  [ticket/12730] Value shouldn't be escaped for schema_data.sql
  [ticket/12730] Missing newline at type_googleplus_test.php
  [ticket/12730] Set field_active to 1 for Google+ field
  [ticket/12730] Add unit test for type_googleplus
  [ticket/12730] Add missing brackets to type_googleplus.php
  [ticket/12730] Update field_order for Google+ CPF
  [ticket/12730] Use string template for Google+ CPF instead of a new one
  [ticket/12730] Minor formatting fixes
  [ticket/12730] Incorrect indentation for type_googleplus
  [ticket/12730] Spaces in block header
  [ticket/12730] Add a Google+ field by default
  [ticket/12730] Add Google+ profile field type
This commit is contained in:
Joas Schilling
2014-06-22 19:56:49 +02:00
11 changed files with 200 additions and 1 deletions

View File

@@ -26,6 +26,7 @@ class phpbb_functional_ucp_profile_test extends phpbb_functional_test_case
$form = $crawler->selectButton('Submit')->form(array(
'pf_phpbb_facebook' => 'phpbb',
'pf_phpbb_googleplus' => 'phpbb',
'pf_phpbb_location' => 'Bertie´s Empire',
'pf_phpbb_skype' => 'phpbb.skype.account',
'pf_phpbb_twitter' => 'phpbb_twitter',
@@ -39,6 +40,7 @@ class phpbb_functional_ucp_profile_test extends phpbb_functional_test_case
$form = $crawler->selectButton('Submit')->form();
$this->assertEquals('phpbb', $form->get('pf_phpbb_facebook')->getValue());
$this->assertEquals('phpbb', $form->get('pf_phpbb_googleplus')->getValue());
$this->assertEquals('Bertie´s Empire', $form->get('pf_phpbb_location')->getValue());
$this->assertEquals('phpbb.skype.account', $form->get('pf_phpbb_skype')->getValue());
$this->assertEquals('phpbb_twitter', $form->get('pf_phpbb_twitter')->getValue());

View File

@@ -0,0 +1,62 @@
<?php
/**
*
* This file is part of the phpBB Forum Software package.
*
* @copyright (c) phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
* For full copyright and license information, please see
* the docs/CREDITS.txt file.
*
*/
class phpbb_profilefield_type_googleplus_test extends phpbb_test_case
{
public function get_profile_contact_value_data()
{
return array(
array(
'112010191010100',
array(),
'112010191010100',
'Field should return a numerical Google+ ID as is',
),
array(
'TestUsername',
array(),
'+TestUsername',
'Field should return a string Google+ ID with a + prefixed',
),
);
}
/**
* @dataProvider get_profile_contact_value_data
*/
public function test_get_profile_contact_value($value, $field_options, $expected, $description)
{
$user = $this->getMock('\phpbb\user');
$request = $this->getMock('\phpbb\request\request');
$template = $this->getMock('\phpbb\template\template');
$field = new \phpbb\profilefields\type\type_googleplus(
$request,
$template,
$user
);
$default_field_options = array(
'field_type' => '\phpbb\profilefields\type\type_googleplus',
'field_name' => 'field',
'field_id' => 1,
'lang_id' => 1,
'lang_name' => 'field',
'field_required' => false,
'field_validation' => '[\w]+',
);
$field_options = array_merge($default_field_options, $field_options);
$this->assertSame($expected, $field->get_profile_contact_value($value, $field_options), $description);
}
}