text:
<?php
namespace TYPO3\Fluid\Tests\Unit\ViewHelpers\Form;

use TYPO3\Flow\Persistence\PersistenceManagerInterface;

require_once(__DIR__ . '/Fixtures/EmptySyntaxTreeNode.php');
require_once(__DIR__ . '/Fixtures/Fixture_UserDomainClass.php');
require_once(__DIR__ . '/FormFieldViewHelperBaseTestcase.php');

/**
 * Test for the "Select" Form view helper
 */
class SelectViewHelperTest extends \TYPO3\Fluid\Tests\Unit\ViewHelpers\Form\FormFieldViewHelperBaseTestcase
{
    /**
     * @var \TYPO3\Fluid\ViewHelpers\Form\SelectViewHelper
     */
    protected $viewHelper;

    public function setUp()
    {
        parent::setUp();
        $this->arguments['name'] = '';
        $this->arguments['sortByOptionLabel'] = false;
        $this->viewHelper = $this->getAccessibleMock(\TYPO3\Fluid\ViewHelpers\Form\SelectViewHelper::class, array('setErrorClassAttribute', 'registerFieldNameForFormTokenGeneration'));
    }

    /**
     * @test
     */
    public function selectCorrectlySetsTagName()
    {
        $this->tagBuilder->expects($this->once())->method('setTagName')->with('select');

        $this->arguments['options'] = array();
        $this->injectDependenciesIntoViewHelper($this->viewHelper);

        $this->viewHelper->initialize();
        $this->viewHelper->render();
    }

    /**
     * @test
     */
    public function selectCreatesExpectedOptions()
    {
        $this->tagBuilder->expects($this->once())->method('addAttribute')->with('name', 'myName');
        $this->viewHelper->expects($this->once())->method('registerFieldNameForFormTokenGeneration')->with('myName');
        $this->tagBuilder->expects($this->once())->method('setContent')->with('<option value="value1">label1</option>' . chr(10) . '<option value="value2" selected="selected">label2</option>' . chr(10));
        $this->tagBuilder->expects($this->once())->method('render');

        $this->arguments['options'] = array(
            'value1' => 'label1',
            'value2' => 'label2'
        );
        $this->arguments['value'] = 'value2';
        $this->arguments['name'] = 'myName';

        $this->injectDependenciesIntoViewHelper($this->viewHelper);
        $this->viewHelper->initialize();
        $this->viewHelper->render();
    }

    /**
     * @test
     */
    public function anEmptyOptionTagIsRenderedIfOptionsArrayIsEmptyToAssureXhtmlCompatibility()
    {
        $this->tagBuilder->expects($this->once())->method('addAttribute')->with('name', 'myName');
        $this->viewHelper->expects($this->once())->method('registerFieldNameForFormTokenGeneration')->with('myName');
        $this->tagBuilder->expects($this->once())->method('setContent')->with('<option value=""></option>' . chr(10));
        $this->tagBuilder->expects($this->once())->method('render');

        $this->arguments['options'] = array();
        $this->arguments['value'] = 'value2';
        $this->arguments['name'] = 'myName';
        $this->injectDependenciesIntoViewHelper($this->viewHelper);

        $this->viewHelper->initialize();
        $this->viewHelper->render();
    }

    /**
     * @test
     */
    public function orderOfOptionsIsNotAlteredByDefault()
    {
        $this->tagBuilder->expects($this->once())->method('addAttribute')->with('name', 'myName');
        $this->viewHelper->expects($this->once())->method('registerFieldNameForFormTokenGeneration')->with('myName');
        $this->tagBuilder->expects($this->once())->method('setContent')->with('<option value="value3">label3</option>' . chr(10) . '<option value="value1">label1</option>' . chr(10) . '<option value="value2" selected="selected">label2</option>' . chr(10));
        $this->tagBuilder->expects($this->once())->method('render');

        $this->arguments['options'] = array(
            'value3' => 'label3',
            'value1' => 'label1',
            'value2' => 'label2'
        );

        $this->arguments['value'] = 'value2';
        $this->arguments['name'] = 'myName';

        $this->injectDependenciesIntoViewHelper($this->viewHelper);

        $this->viewHelper->initialize();
        $this->viewHelper->render();
    }

    /**
     * @test
     */
    public function optionsAreSortedByLabelIfSortByOptionLabelIsSet()
    {
        $this->tagBuilder->expects($this->once())->method('addAttribute')->with('name', 'myName');
        $this->viewHelper->expects($this->once())->method('registerFieldNameForFormTokenGeneration')->with('myName');
        $this->tagBuilder->expects($this->once())->method('setContent')->with('<option value="value1">label1</option>' . chr(10) . '<option value="value2" selected="selected">label2</option>' . chr(10) . '<option value="value3">label3</option>' . chr(10));
        $this->tagBuilder->expects($this->once())->method('render');

        $this->arguments['options'] = array(
            'value3' => 'label3',
            'value1' => 'label1',
            'value2' => 'label2'
        );

        $this->arguments['value'] = 'value2';
        $this->arguments['name'] = 'myName';
        $this->arguments['sortByOptionLabel'] = true;

        $this->injectDependenciesIntoViewHelper($this->viewHelper);

        $this->viewHelper->initialize();
        $this->viewHelper->render();
    }

    /**
     * @test
     */
    public function multipleSelectCreatesExpectedOptions()
    {
        $this->tagBuilder = new \TYPO3\Fluid\Core\ViewHelper\TagBuilder();

        $this->arguments['options'] = array(
            'value1' => 'label1',
            'value2' => 'label2',
            'value3' => 'label3'
        );

        $this->arguments['value'] = array('value3', 'value1');
        $this->arguments['name'] = 'myName';
        $this->arguments['multiple'] = 'multiple';

        $this->injectDependenciesIntoViewHelper($this->viewHelper);

        $this->viewHelper->initializeArguments();
        $this->viewHelper->initialize();
        $result = $this->viewHelper->render();
        $expected = '<select multiple="multiple" name="myName[]"><option value="value1" selected="selected">label1</option>' . chr(10) .
            '<option value="value2">label2</option>' . chr(10) .
            '<option value="value3" selected="selected">label3</option>' . chr(10) .
            '</select>';
        $this->assertSame($expected, $result);
    }

    /**
     * @test
     */
    public function multipleSelectCreatesExpectedOptionsInObjectAccessorMode()
    {
        $this->tagBuilder = new \TYPO3\Fluid\Core\ViewHelper\TagBuilder();

        $user = new \TYPO3\Fluid\ViewHelpers\Fixtures\UserDomainClass(1, 'Sebastian', 'Düvel');

        $this->viewHelperVariableContainerData = array(
            \TYPO3\Fluid\ViewHelpers\FormViewHelper::class => array(
                'formObjectName' => 'someFormObjectName',
                'formObject' => $user,
            )
        );

        $this->arguments['options'] = array(
            'value1' => 'label1',
            'value2' => 'label2',
            'value3' => 'label3'
        );
        $this->arguments['property'] = 'interests';
        $this->arguments['multiple'] = 'multiple';
        $this->arguments['selectAllByDefault'] = null;

        /** @var PersistenceManagerInterface|\PHPUnit_Framework_MockObject_MockObject $mockPersistenceManager */
        $mockPersistenceManager = $this->getMock(\TYPO3\Flow\Persistence\PersistenceManagerInterface::class);
        $mockPersistenceManager->expects($this->any())->method('getIdentifierByObject')->with($user->getInterests())->will($this->returnValue(null));
        $this->viewHelper->injectPersistenceManager($mockPersistenceManager);

        $this->injectDependenciesIntoViewHelper($this->viewHelper);

        $this->viewHelper->initializeArguments();
        $this->viewHelper->initialize();
        $result = $this->viewHelper->render();
        $expected = '<select multiple="multiple" name="someFormObjectName[interests][]"><option value="value1" selected="selected">label1</option>' . chr(10) .
            '<option value="value2">label2</option>' . chr(10) .
            '<option value="value3" selected="selected">label3</option>' . chr(10) .
            '</select>';
        $this->assertSame($expected, $result);
    }

    /**
     * @test
     */
    public function selectOnDomainObjectsCreatesExpectedOptions()
    {
        $mockPersistenceManager = $this->getMock(\TYPO3\Flow\Persistence\PersistenceManagerInterface::class);
        $mockPersistenceManager->expects($this->any())->method('getIdentifierByObject')->will($this->returnValue(2));
        $this->viewHelper->injectPersistenceManager($mockPersistenceManager);

        $this->tagBuilder->expects($this->once())->method('addAttribute')->with('name', 'myName[__identity]');
        $this->viewHelper->expects($this->once())->method('registerFieldNameForFormTokenGeneration')->with('myName[__identity]');
        $this->tagBuilder->expects($this->once())->method('setContent')->with('<option value="1">Ingmar</option>' . chr(10) . '<option value="2" selected="selected">Sebastian</option>' . chr(10) . '<option value="3">Robert</option>' . chr(10));
        $this->tagBuilder->expects($this->once())->method('render');

        $user_is = new \TYPO3\Fluid\ViewHelpers\Fixtures\UserDomainClass(1, 'Ingmar', 'Schlecht');
        $user_sk = new \TYPO3\Fluid\ViewHelpers\Fixtures\UserDomainClass(2, 'Sebastian', 'Kurfuerst');
        $user_rl = new \TYPO3\Fluid\ViewHelpers\Fixtures\UserDomainClass(3, 'Robert', 'Lemke');

        $this->arguments['options'] = array(
            $user_is,
            $user_sk,
            $user_rl
        );

        $this->arguments['value'] = $user_sk;
        $this->arguments['optionValueField'] = 'id';
        $this->arguments['optionLabelField'] = 'firstName';
        $this->arguments['name'] = 'myName';
        $this->injectDependenciesIntoViewHelper($this->viewHelper);

        $this->viewHelper->initialize();
        $this->viewHelper->render();
    }

    /**
     * @test
     */
    public function multipleSelectOnDomainObjectsCreatesExpectedOptions()
    {
        $this->tagBuilder = new \TYPO3\Fluid\Core\ViewHelper\TagBuilder();
        $this->viewHelper->expects($this->exactly(3))->method('registerFieldNameForFormTokenGeneration')->with('myName[]');

        $user_is = new \TYPO3\Fluid\ViewHelpers\Fixtures\UserDomainClass(1, 'Ingmar', 'Schlecht');
        $user_sk = new \TYPO3\Fluid\ViewHelpers\Fixtures\UserDomainClass(2, 'Sebastian', 'Kurfuerst');
        $user_rl = new \TYPO3\Fluid\ViewHelpers\Fixtures\UserDomainClass(3, 'Robert', 'Lemke');

        $this->arguments['options'] = array(
            $user_is,
            $user_sk,
            $user_rl
        );
        $this->arguments['value'] = array($user_rl, $user_is);
        $this->arguments['optionValueField'] = 'id';
        $this->arguments['optionLabelField'] = 'lastName';
        $this->arguments['name'] = 'myName';
        $this->arguments['multiple'] = 'multiple';

        $this->injectDependenciesIntoViewHelper($this->viewHelper);

        $this->viewHelper->initializeArguments();
        $this->viewHelper->initialize();
        $actual = $this->viewHelper->render();

        $expected = '<select multiple="multiple" name="myName[]"><option value="1" selected="selected">Schlecht</option>' . chr(10) .
            '<option value="2">Kurfuerst</option>' . chr(10) .
            '<option value="3" selected="selected">Lemke</option>' . chr(10) .
            '</select>';
        $this->assertSame($expected, $actual);
    }

    /**
     * @test
     */
    public function multipleSelectOnDomainObjectsCreatesExpectedOptionsWithoutOptionValueField()
    {
        $mockPersistenceManager = $this->getMock(\TYPO3\Flow\Persistence\PersistenceManagerInterface::class);
        $mockPersistenceManager->expects($this->any())->method('getIdentifierByObject')->will($this->returnCallback(
            function ($object) {
                return $object->getId();
            }
        ));
        $this->viewHelper->injectPersistenceManager($mockPersistenceManager);

        $this->tagBuilder = new \TYPO3\Fluid\Core\ViewHelper\TagBuilder();
        $this->viewHelper->expects($this->exactly(3))->method('registerFieldNameForFormTokenGeneration')->with('myName[]');

        $user_is = new \TYPO3\Fluid\ViewHelpers\Fixtures\UserDomainClass(1, 'Ingmar', 'Schlecht');
        $user_sk = new \TYPO3\Fluid\ViewHelpers\Fixtures\UserDomainClass(2, 'Sebastian', 'Kurfuerst');
        $user_rl = new \TYPO3\Fluid\ViewHelpers\Fixtures\UserDomainClass(3, 'Robert', 'Lemke');

        $this->arguments['options'] = array($user_is,$user_sk,$user_rl);
        $this->arguments['value'] = array($user_rl, $user_is);
        $this->arguments['optionLabelField'] = 'lastName';
        $this->arguments['name'] = 'myName';
        $this->arguments['multiple'] = 'multiple';

        $this->injectDependenciesIntoViewHelper($this->viewHelper);

        $this->viewHelper->initializeArguments();
        $this->viewHelper->initialize();
        $actual = $this->viewHelper->render();

        $expected = '<select multiple="multiple" name="myName[]">' .
            '<option value="1" selected="selected">Schlecht</option>' . chr(10) .
            '<option value="2">Kurfuerst</option>' . chr(10) .
            '<option value="3" selected="selected">Lemke</option>' . chr(10) .
            '</select>';
        $this->assertSame($expected, $actual);
    }

    /**
     * @test
     */
    public function selectWithoutFurtherConfigurationOnDomainObjectsUsesUuidForValueAndLabel()
    {
        $mockPersistenceManager = $this->getMock(\TYPO3\Flow\Persistence\PersistenceManagerInterface::class);
        $mockPersistenceManager->expects($this->any())->method('getIdentifierByObject')->will($this->returnValue('fakeUUID'));
        $this->viewHelper->injectPersistenceManager($mockPersistenceManager);

        $this->tagBuilder->expects($this->once())->method('addAttribute')->with('name', 'myName');
        $this->viewHelper->expects($this->once())->method('registerFieldNameForFormTokenGeneration')->with('myName');
        $this->tagBuilder->expects($this->once())->method('setContent')->with('<option value="fakeUUID">fakeUUID</option>' . chr(10));
        $this->tagBuilder->expects($this->once())->method('render');

        $user = new \TYPO3\Fluid\ViewHelpers\Fixtures\UserDomainClass(1, 'Ingmar', 'Schlecht');

        $this->arguments['options'] = array(
            $user
        );
        $this->arguments['name'] = 'myName';
        $this->injectDependenciesIntoViewHelper($this->viewHelper);

        $this->viewHelper->initialize();
        $this->viewHelper->render();
    }

    /**
     * @test
     */
    public function selectWithoutFurtherConfigurationOnDomainObjectsUsesToStringForLabelIfAvailable()
    {
        $mockPersistenceManager = $this->getMock(\TYPO3\Flow\Persistence\PersistenceManagerInterface::class);
        $mockPersistenceManager->expects($this->any())->method('getIdentifierByObject')->will($this->returnValue('fakeUUID'));
        $this->viewHelper->injectPersistenceManager($mockPersistenceManager);

        $this->tagBuilder->expects($this->once())->method('addAttribute')->with('name', 'myName');
        $this->viewHelper->expects($this->once())->method('registerFieldNameForFormTokenGeneration')->with('myName');
        $this->tagBuilder->expects($this->once())->method('setContent')->with('<option value="fakeUUID">toStringResult</option>' . chr(10));
        $this->tagBuilder->expects($this->once())->method('render');

        $user = $this->getMock(\TYPO3\Fluid\ViewHelpers\Fixtures\UserDomainClass::class, array('__toString'), array(1, 'Ingmar', 'Schlecht'));
        $user->expects($this->atLeastOnce())->method('__toString')->will($this->returnValue('toStringResult'));

        $this->arguments['options'] = array(
            $user
        );
        $this->arguments['name'] = 'myName';
        $this->injectDependenciesIntoViewHelper($this->viewHelper);

        $this->viewHelper->initialize();
        $this->viewHelper->render();
    }

    /**
     * @test
     * @expectedException \TYPO3\Fluid\Core\ViewHelper\Exception
     */
    public function selectOnDomainObjectsThrowsExceptionIfNoValueCanBeFound()
    {
        $mockPersistenceManager = $this->getMock(\TYPO3\Flow\Persistence\PersistenceManagerInterface::class);
        $mockPersistenceManager->expects($this->any())->method('getIdentifierByObject')->will($this->returnValue(null));
        $this->viewHelper->injectPersistenceManager($mockPersistenceManager);

        $user = new \TYPO3\Fluid\ViewHelpers\Fixtures\UserDomainClass(1, 'Ingmar', 'Schlecht');

        $this->arguments['options'] = array(
            $user
        );
        $this->arguments['name'] = 'myName';
        $this->injectDependenciesIntoViewHelper($this->viewHelper);

        $this->viewHelper->initialize();
        $this->viewHelper->render();
    }

    /**
     * @test
     */
    public function renderCallsSetErrorClassAttribute()
    {
        $this->arguments['options'] = array();

        $this->injectDependenciesIntoViewHelper($this->viewHelper);

        $this->viewHelper->expects($this->once())->method('setErrorClassAttribute');
        $this->viewHelper->render();
    }

    /**
     * @test
     */
    public function allOptionsAreSelectedIfSelectAllIsTrue()
    {
        $this->tagBuilder->expects($this->once())->method('setContent')->with('<option value="value1" selected="selected">label1</option>' . chr(10) . '<option value="value2" selected="selected">label2</option>' . chr(10) . '<option value="value3" selected="selected">label3</option>' . chr(10));

        $this->arguments['options'] = array(
            'value1' => 'label1',
            'value2' => 'label2',
            'value3' => 'label3'
        );
        $this->arguments['name'] = 'myName';
        $this->arguments['multiple'] = 'multiple';
        $this->arguments['selectAllByDefault'] = true;

        $this->injectDependenciesIntoViewHelper($this->viewHelper);

        $this->viewHelper->initialize();
        $this->viewHelper->render();
    }

    /**
     * @test
     */
    public function selectAllHasNoEffectIfValueIsSet()
    {
        $this->tagBuilder->expects($this->once())->method('setContent')->with('<option value="value1" selected="selected">label1</option>' . chr(10) . '<option value="value2" selected="selected">label2</option>' . chr(10) . '<option value="value3">label3</option>' . chr(10));

        $this->arguments['options'] = array(
            'value1' => 'label1',
            'value2' => 'label2',
            'value3' => 'label3'
        );
        $this->arguments['value'] = array('value2', 'value1');
        $this->arguments['name'] = 'myName';
        $this->arguments['multiple'] = 'multiple';
        $this->arguments['selectAllByDefault'] = true;

        $this->injectDependenciesIntoViewHelper($this->viewHelper);

        $this->viewHelper->initialize();
        $this->viewHelper->render();
    }

    /**
     * @test
     */
    public function translateLabelIsCalledIfTranslateArgumentIsGiven()
    {
        $this->arguments['options'] = array('foo' => 'bar');
        $this->arguments['translate'] = array('by' => 'id');
        $viewHelper = $this->getAccessibleMock(\TYPO3\Fluid\ViewHelpers\Form\SelectViewHelper::class, array('getTranslatedLabel', 'setErrorClassAttribute', 'registerFieldNameForFormTokenGeneration'));
        $this->injectDependenciesIntoViewHelper($viewHelper);

        $viewHelper->expects($this->once())->method('getTranslatedLabel')->with('foo', 'bar');
        $viewHelper->render();
    }

    /**
     * @test
     */
    public function translateByIdAskForTranslationOfValueById()
    {
        $this->arguments['translate'] = array('by' => 'id');
        $this->injectDependenciesIntoViewHelper($this->viewHelper);

        $mockTranslator = $this->getMock(\TYPO3\Flow\I18n\Translator::class);
        $mockTranslator->expects($this->once())->method('translateById')->with('value1', array(), null, null, 'Main', '');
        $this->viewHelper->_set('translator', $mockTranslator);
        $this->viewHelper->_call('getTranslatedLabel', 'value1', 'label1');
    }

    /**
     * @test
     */
    public function translateByLabelAskForTranslationOfLabelByLabel()
    {
        $this->arguments['translate'] = array('by' => 'label');
        $this->injectDependenciesIntoViewHelper($this->viewHelper);

        $mockTranslator = $this->getMock(\TYPO3\Flow\I18n\Translator::class);
        $mockTranslator->expects($this->once())->method('translateByOriginalLabel')->with('label1', array(), null, null, 'Main', '');
        $this->viewHelper->_set('translator', $mockTranslator);
        $this->viewHelper->_call('getTranslatedLabel', 'value1', 'label1');
    }

    /**
     * @test
     */
    public function translateByLabelUsingValueUsesValue()
    {
        $this->arguments['translate'] = array('by' => 'label', 'using' => 'value');
        $this->injectDependenciesIntoViewHelper($this->viewHelper);

        $mockTranslator = $this->getMock(\TYPO3\Flow\I18n\Translator::class);
        $mockTranslator->expects($this->once())->method('translateByOriginalLabel')->with('value1', array(), null, null, 'Main', '');
        $this->viewHelper->_set('translator', $mockTranslator);
        $this->viewHelper->_call('getTranslatedLabel', 'value1', 'label1');
    }

    /**
     * @test
     */
    public function translateByIdUsingLabelUsesLabel()
    {
        $this->arguments['translate'] = array('by' => 'id', 'using' => 'label');
        $this->injectDependenciesIntoViewHelper($this->viewHelper);

        $mockTranslator = $this->getMock(\TYPO3\Flow\I18n\Translator::class);
        $mockTranslator->expects($this->once())->method('translateById')->with('label1', array(), null, null, 'Main', '');
        $this->viewHelper->_set('translator', $mockTranslator);
        $this->viewHelper->_call('getTranslatedLabel', 'value1', 'label1');
    }

    /**
     * @test
     */
    public function translateOptionsAreObserved()
    {
        $this->arguments['translate'] = array('by' => 'id', 'using' => 'label', 'locale' => 'dk', 'source' => 'WeirdMessageCatalog', 'package' => 'Foo.Bar', 'prefix' => 'somePrefix.');
        $this->injectDependenciesIntoViewHelper($this->viewHelper);

        $mockTranslator = $this->getMock(\TYPO3\Flow\I18n\Translator::class);
        $mockTranslator->expects($this->once())->method('translateById')->with('somePrefix.label1', array(), null, new \TYPO3\Flow\I18n\Locale('dk'), 'WeirdMessageCatalog', 'Foo.Bar');
        $this->viewHelper->_set('translator', $mockTranslator);
        $this->viewHelper->_call('getTranslatedLabel', 'value1', 'label1');
    }

    /**
     * @test
     */
    public function optionsContainPrependedItemWithEmptyValueIfPrependOptionLabelIsSet()
    {
        $this->tagBuilder->expects($this->once())->method('addAttribute')->with('name', 'myName');
        $this->viewHelper->expects($this->once())->method('registerFieldNameForFormTokenGeneration')->with('myName');
        $this->tagBuilder->expects($this->once())->method('setContent')->with('<option value="">please choose</option>' . chr(10) . '<option value="value1">label1</option>' . chr(10) . '<option value="value2">label2</option>' . chr(10) . '<option value="value3">label3</option>' . chr(10));
        $this->tagBuilder->expects($this->once())->method('render');
        $this->arguments['options'] = array(
            'value1' => 'label1',
            'value2' => 'label2',
            'value3' => 'label3'
        );
        $this->arguments['name'] = 'myName';
        $this->arguments['prependOptionLabel'] = 'please choose';
        $this->injectDependenciesIntoViewHelper($this->viewHelper);
        $this->viewHelper->initialize();
        $this->viewHelper->render();
    }

    /**
     * @test
     */
    public function optionsContainPrependedItemWithCorrectValueIfPrependOptionLabelAndPrependOptionValueAreSet()
    {
        $this->tagBuilder->expects($this->once())->method('addAttribute')->with('name', 'myName');
        $this->viewHelper->expects($this->once())->method('registerFieldNameForFormTokenGeneration')->with('myName');
        $this->tagBuilder->expects($this->once())->method('setContent')->with('<option value="-1">please choose</option>' . chr(10) . '<option value="value1">label1</option>' . chr(10) . '<option value="value2">label2</option>' . chr(10) . '<option value="value3">label3</option>' . chr(10));
        $this->tagBuilder->expects($this->once())->method('render');
        $this->arguments['options'] = array(
            'value1' => 'label1',
            'value2' => 'label2',
            'value3' => 'label3'
        );
        $this->arguments['name'] = 'myName';
        $this->arguments['prependOptionLabel'] = 'please choose';
        $this->arguments['prependOptionValue'] = '-1';
        $this->injectDependenciesIntoViewHelper($this->viewHelper);
        $this->viewHelper->initialize();
        $this->viewHelper->render();
    }

    /**
     * @test
     */
    public function prependedOptionLabelIsTranslatedIfTranslateArgumentIsSet()
    {
        $this->tagBuilder->expects($this->once())->method('addAttribute')->with('name', 'myName');
        $this->viewHelper->expects($this->once())->method('registerFieldNameForFormTokenGeneration')->with('myName');
        $this->tagBuilder->expects($this->once())->method('setContent')->with('<option value="">translated label</option>' . chr(10));
        $this->tagBuilder->expects($this->once())->method('render');
        $this->arguments['options'] = array();
        $this->arguments['name'] = 'myName';
        $this->arguments['prependOptionLabel'] = 'select';
        $this->arguments['translate'] = array('by' => 'id', 'using' => 'label');

        $mockTranslator = $this->getMock(\TYPO3\Flow\I18n\Translator::class);
        $mockTranslator->expects($this->at(0))->method('translateById')->with('select', array(), null, null, 'Main', '')->will($this->returnValue('translated label'));
        $this->viewHelper->_set('translator', $mockTranslator);

        $this->injectDependenciesIntoViewHelper($this->viewHelper);
        $this->viewHelper->initialize();
        $this->viewHelper->render();
    }
}


text:
<?php

/**
* <auto-generated>
*     This code was generated by Codezu.
*
*     Changes to this file may cause incorrect behavior and will be lost if
*     the code is regenerated.
* </auto-generated>
*/

namespace Mozu\Api\Clients\Commerce\Orders;

use Mozu\Api\MozuClient;
use Mozu\Api\Urls\Commerce\Orders\AppliedDiscountUrl;

/**
* Use this subresource to apply coupons to or remove coupons from an order based on a supplied coupon code.
*/
class AppliedDiscountClient {

	/**
	* Apply a coupon to the order.
	*
	* @param string $couponCode Alphanumeric code associated with the coupon or promotion that results in a discounted price.
	* @param string $orderId Unique identifier of the order.
	* @param string $responseFields Use this field to include those fields which are not included by default.
	* @param string $updateMode Specifies whether to update the original order, update the order in draft mode, or update the order in draft mode and then commit the changes to the original. Draft mode enables users to make incremental order changes before committing the changes to the original order. Valid values are "ApplyToOriginal," "ApplyToDraft," or "ApplyAndCommit."
	* @param string $version System-supplied integer that represents the current version of the order, which prevents users from unintentionally overriding changes to the order. When a user performs an operation for a defined order, the system validates that the version of the updated order matches the version of the order on the server. After the operation completes successfully, the system increments the version number by one.
	* @return MozuClient
	*/
	public static function applyCouponClient($orderId, $couponCode, $updateMode =  null, $version =  null, $responseFields =  null)
	{
		$url = AppliedDiscountUrl::applyCouponUrl($couponCode, $orderId, $responseFields, $updateMode, $version);
		$mozuClient = new MozuClient();
		$mozuClient->withResourceUrl($url);
		return $mozuClient;

	}

	/**
	* Removes a coupon previously applied to the order.
	*
	* @param string $couponCode Alphanumeric code associated with the coupon or promotion that results in a discounted price.
	* @param string $orderId Unique identifier of the order.
	* @param string $updateMode Specifies whether to update the original order, update the order in draft mode, or update the order in draft mode and then commit the changes to the original. Draft mode enables users to make incremental order changes before committing the changes to the original order. Valid values are "ApplyToOriginal," "ApplyToDraft," or "ApplyAndCommit."
	* @param string $version System-supplied integer that represents the current version of the order, which prevents users from unintentionally overriding changes to the order. When a user performs an operation for a defined order, the system validates that the version of the updated order matches the version of the order on the server. After the operation completes successfully, the system increments the version number by one.
	* @return MozuClient
	*/
	public static function removeCouponClient($orderId, $couponCode, $updateMode =  null, $version =  null)
	{
		$url = AppliedDiscountUrl::removeCouponUrl($couponCode, $orderId, $updateMode, $version);
		$mozuClient = new MozuClient();
		$mozuClient->withResourceUrl($url);
		return $mozuClient;

	}

	/**
	* Removes all coupons previously applied to the order.
	*
	* @param string $orderId Unique identifier of the order.
	* @param string $updateMode Specifies whether to update the original order, update the order in draft mode, or update the order in draft mode and then commit the changes to the original. Draft mode enables users to make incremental order changes before committing the changes to the original order. Valid values are "ApplyToOriginal," "ApplyToDraft," or "ApplyAndCommit."
	* @param string $version System-supplied integer that represents the current version of the order, which prevents users from unintentionally overriding changes to the order. When a user performs an operation for a defined order, the system validates that the version of the updated order matches the version of the order on the server. After the operation completes successfully, the system increments the version number by one.
	* @return MozuClient
	*/
	public static function removeCouponsClient($orderId, $updateMode =  null, $version =  null)
	{
		$url = AppliedDiscountUrl::removeCouponsUrl($orderId, $updateMode, $version);
		$mozuClient = new MozuClient();
		$mozuClient->withResourceUrl($url);
		return $mozuClient;

	}

}

?>

redpajama_set_name: RedPajamaGithub


text:
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif

#include <stdio.h>
#include <X11/X.h>
#include <X11/Xproto.h>
#include <X11/keysym.h>
#include "inputstr.h"
#include "scrnintstr.h"
#include "windowstr.h"
#include <xkbsrv.h>
#include <X11/extensions/XI.h>

/*#define FALLING_TONE	1*/
/*#define RISING_TONE	1*/
#define FALLING_TONE	10
#define RISING_TONE	10
#define	SHORT_TONE	50
#define	SHORT_DELAY	60
#define	LONG_TONE	75
#define	VERY_LONG_TONE	100
#define	LONG_DELAY	85
#define CLICK_DURATION	1

#define	DEEP_PITCH	250
#define	LOW_PITCH	500
#define	MID_PITCH	1000
#define	HIGH_PITCH	2000
#define CLICK_PITCH	1500

static	unsigned long	atomGeneration= 0;
static	Atom	featureOn;
static	Atom	featureOff;
static	Atom	featureChange;
static	Atom	ledOn;
static	Atom	ledOff;
static	Atom	ledChange;
static	Atom	slowWarn;
static	Atom	slowPress;
static	Atom	slowReject;
static	Atom	slowAccept;
static	Atom	slowRelease;
static	Atom	stickyLatch;
static	Atom	stickyLock;
static	Atom	stickyUnlock;
static	Atom	bounceReject;
static  char 	doesPitch = 1;

#define	FEATURE_ON	"AX_FeatureOn"
#define	FEATURE_OFF	"AX_FeatureOff"
#define	FEATURE_CHANGE	"AX_FeatureChange"
#define	LED_ON		"AX_IndicatorOn"
#define	LED_OFF		"AX_IndicatorOff"
#define	LED_CHANGE	"AX_IndicatorChange"
#define	SLOW_WARN	"AX_SlowKeysWarning"
#define	SLOW_PRESS	"AX_SlowKeyPress"
#define	SLOW_REJECT	"AX_SlowKeyReject"
#define	SLOW_ACCEPT	"AX_SlowKeyAccept"
#define	SLOW_RELEASE	"AX_SlowKeyRelease"
#define	STICKY_LATCH	"AX_StickyLatch"
#define	STICKY_LOCK	"AX_StickyLock"
#define	STICKY_UNLOCK	"AX_StickyUnlock"
#define	BOUNCE_REJECT	"AX_BounceKeyReject"

#define	MAKE_ATOM(a)	MakeAtom(a,sizeof(a)-1,TRUE)

static void
_XkbDDXBeepInitAtoms(void)
{
    featureOn= 		MAKE_ATOM(FEATURE_ON);
    featureOff= 	MAKE_ATOM(FEATURE_OFF);
    featureChange= 	MAKE_ATOM(FEATURE_CHANGE);
    ledOn= 		MAKE_ATOM(LED_ON);
    ledOff= 		MAKE_ATOM(LED_OFF);
    ledChange= 		MAKE_ATOM(LED_CHANGE);
    slowWarn= 		MAKE_ATOM(SLOW_WARN);
    slowPress= 		MAKE_ATOM(SLOW_PRESS);
    slowReject= 	MAKE_ATOM(SLOW_REJECT);
    slowAccept= 	MAKE_ATOM(SLOW_ACCEPT);
    slowRelease= 	MAKE_ATOM(SLOW_RELEASE);
    stickyLatch= 	MAKE_ATOM(STICKY_LATCH);
    stickyLock=		MAKE_ATOM(STICKY_LOCK);
    stickyUnlock= 	MAKE_ATOM(STICKY_UNLOCK);
    bounceReject= 	MAKE_ATOM(BOUNCE_REJECT);
    return;
}

static CARD32
_XkbDDXBeepExpire(OsTimerPtr timer,CARD32 now,pointer arg)
{
DeviceIntPtr	dev= (DeviceIntPtr)arg;
KbdFeedbackPtr	feed;
KeybdCtrl *	ctrl;
XkbSrvInfoPtr	xkbInfo;
CARD32		next;
int		pitch,duration;
int		oldPitch,oldDuration;
Atom		name;

    if ((dev==NULL)||(dev->key==NULL)||(dev->key->xkbInfo==NULL)||
	(dev->kbdfeed==NULL))
	return 0;
    if (atomGeneration!=serverGeneration) {
	_XkbDDXBeepInitAtoms();
	atomGeneration= serverGeneration;
    }

    feed= dev->kbdfeed;
    ctrl= &feed->ctrl;
    xkbInfo= dev->key->xkbInfo;
    next= 0;
    pitch= oldPitch= ctrl->bell_pitch;
    duration= oldDuration= ctrl->bell_duration;
    name= None;
    switch (xkbInfo->beepType) {
	default:
	    ErrorF("[xkb] Unknown beep type %d\n",xkbInfo->beepType);
	case _BEEP_NONE:
	    duration= 0;
	    break;

	/* When an LED is turned on, we want a high-pitched beep.
	 * When the LED it turned off, we want a low-pitched beep.
	 * If we cannot do pitch, we want a single beep for on and two
	 * beeps for off.
         */
	case _BEEP_LED_ON:
	    if (name==None)	name= ledOn;
	    duration= SHORT_TONE;
	    pitch= HIGH_PITCH;
	    break;
	case _BEEP_LED_OFF:
	    if (name==None)	name= ledOff;
	    duration= SHORT_TONE;
	    pitch= LOW_PITCH;
	    if (!doesPitch && xkbInfo->beepCount<1)
		next = SHORT_DELAY;
	    break;

	/* When a Feature is turned on, we want an up-siren.
	 * When a Feature is turned off, we want a down-siren.
	 * If we cannot do pitch, we want a single beep for on and two
	 * beeps for off.
         */
	case _BEEP_FEATURE_ON:
	    if (name==None)	name= featureOn;
	    if (xkbInfo->beepCount<1) {
		pitch= LOW_PITCH;
		duration= VERY_LONG_TONE;
		if (doesPitch)
		    next= SHORT_DELAY;
	    }
	    else {
		pitch= MID_PITCH;
		duration= SHORT_TONE;
	    }
	    break;

	case _BEEP_FEATURE_OFF:
	    if (name==None)	name= featureOff;
	    if (xkbInfo->beepCount<1) {
		pitch= MID_PITCH;
		if (doesPitch)
		     duration= VERY_LONG_TONE;
		else duration= SHORT_TONE;
		next= SHORT_DELAY;
	    }
	    else {
		pitch= LOW_PITCH;
		duration= SHORT_TONE;
	    }
	    break;

	/* Two high beeps indicate an LED or Feature changed
	 * state, but that another LED or Feature is also on.
	 * [[[WDW - This is not in AccessDOS ]]]
	 */
	case _BEEP_LED_CHANGE:
            if (name==None)	name= ledChange;
	case _BEEP_FEATURE_CHANGE:
	    if (name==None)	name= featureChange;
	    duration= SHORT_TONE;
	    pitch= HIGH_PITCH;
	    if (xkbInfo->beepCount<1) {
		next= SHORT_DELAY;
	    }
            break;

	/* Three high-pitched beeps are the warning that SlowKeys
	 * is going to be turned on or off.
	 */
	case _BEEP_SLOW_WARN:
	    if (name==None)	name= slowWarn;
	    duration= SHORT_TONE;
	    pitch= HIGH_PITCH;
	    if (xkbInfo->beepCount<2)
		next= SHORT_DELAY;
	    break;

	/* Click on SlowKeys press and accept.
	 * Deep pitch when a SlowKey or BounceKey is rejected.
	 * [[[WDW - Rejects are not in AccessDOS ]]]
	 * If we cannot do pitch, we want single beeps.
	 */
        case _BEEP_SLOW_PRESS:
	    if (name==None)	name= slowPress;
	case _BEEP_SLOW_ACCEPT:
	    if (name==None)	name= slowAccept;
	case _BEEP_SLOW_RELEASE:
	    if (name==None)	name= slowRelease;
	    duration= CLICK_DURATION;
	    pitch= CLICK_PITCH;
	    break;
	case _BEEP_BOUNCE_REJECT:
	    if (name==None)	name= bounceReject;
	case _BEEP_SLOW_REJECT:
	    if (name==None)	name= slowReject;
	    duration= SHORT_TONE;
	    pitch= DEEP_PITCH;
	    break;

	/* Low followed by high pitch when a StickyKey is latched.
	 * High pitch when a StickyKey is locked.
	 * Low pitch when unlocked.
         * If we cannot do pitch, two beeps for latch, nothing for
	 * lock, and two for unlock.
	 */
	case _BEEP_STICKY_LATCH:
	    if (name==None)	name= stickyLatch;
	    duration= SHORT_TONE;
	    if (xkbInfo->beepCount<1) {
		next= SHORT_DELAY;
		pitch= LOW_PITCH;
	    }
	    else pitch= HIGH_PITCH;
	    break;
	case _BEEP_STICKY_LOCK:
	    if (name==None)	name= stickyLock;
	    if (doesPitch) {
		duration= SHORT_TONE;
		pitch= HIGH_PITCH;
            }
	    break;
	case _BEEP_STICKY_UNLOCK:
	    if (name==None)	name= stickyUnlock;
	    duration= SHORT_TONE;
	    pitch= LOW_PITCH;
	    if (!doesPitch && xkbInfo->beepCount<1)
		next = SHORT_DELAY;
	    break;
    }
    if (timer == NULL && duration>0) {
	CARD32		starttime = GetTimeInMillis();
	CARD32		elapsedtime;

	ctrl->bell_duration= duration;
	ctrl->bell_pitch= pitch;
	if (xkbInfo->beepCount==0) {
	     XkbHandleBell(0,0,dev,ctrl->bell,(pointer)ctrl,KbdFeedbackClass,name,None,
									NULL);
	}
	else if (xkbInfo->desc->ctrls->enabled_ctrls&XkbAudibleBellMask) {
	    (*dev->kbdfeed->BellProc)(ctrl->bell,dev,(pointer)ctrl,KbdFeedbackClass);
	}
	ctrl->bell_duration= oldDuration;
	ctrl->bell_pitch= oldPitch;
	xkbInfo->beepCount++;

	/* Some DDX schedule the beep and return immediately, others don't
	   return until the beep is completed.  We measure the time and if
	   it's less than the beep duration, make sure not to schedule the
	   next beep until after the current one finishes. */

	elapsedtime = GetTimeInMillis();
	if (elapsedtime > starttime) { /* watch out for millisecond counter
					  overflow! */
	    elapsedtime -= starttime;
	} else {
	    elapsedtime = 0;
	}
	if (elapsedtime < duration) {
	    next += duration - elapsedtime;
	}

    }
    return next;
}

int
XkbDDXAccessXBeep(DeviceIntPtr dev,unsigned what,unsigned which)
{
XkbSrvInfoRec	*xkbInfo= dev->key->xkbInfo;
CARD32		 next;

    xkbInfo->beepType= what;
    xkbInfo->beepCount= 0;
    next= _XkbDDXBeepExpire(NULL,0,(pointer)dev);
    if (next>0) {
	xkbInfo->beepTimer= TimerSet(xkbInfo->beepTimer,
					0, next,
					_XkbDDXBeepExpire, (pointer)dev);
    }
    return 1;
}


text:
<?xml version="1.0" encoding="UTF-8"?>

<!--

   Copyright 2002 Charles Chan

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.

-->

<messages>

	<message name="header.executiveSummary">Summary</message>
	<message name="header.objective">Objective</message>
	<message name="header.qualifications">Qualifications</message>
	<message name="header.employmentHistory">Work Experience</message>
	<message name="header.educationHistory">Education</message>
	<message name="header.licensesAndCertifications">Licenses and Certifications</message>
	<message name="header.publicationHistory">Publications</message>
	<message name="header.publicationHistory.conferencePapers">Conference Papers</message>
	<message name="header.publicationHistory.articles">Articles</message>
	<message name="header.publicationHistory.books">Books</message>
	<message name="header.publicationHistory.otherPublications">Other Publications</message>
	<message name="header.speakingEventsHistory">Speaking Events</message>
	<message name="header.languages">Languages</message>
	<message name="header.achievements">Achievements</message>
	<message name="header.professionalAssociation">Professional Associations</message>
	<message name="header.militaryHistory">Military Experience</message>
	<message name="header.additionalItems">Additional Items</message>
	<message name="header.additionalItems.Activities">Activities</message>
	<message name="header.additionalItems.Interests">Interests</message>
	<message name="header.additionalItems.Personal">Personal</message>
	<message name="header.additionalItems.Community">Community</message>
	<message name="header.additionalItems.Hobbies">Hobbies</message>
	<message name="header.additionalItems.Volunteer">Volunteer</message>
	<message name="header.additionalItems.other">Other</message>
	<message name="header.associations">Associations</message>
	<message name="header.associations.Professional">Professional</message>
	<message name="header.associations.Social">Social</message>
	<message name="header.associations.Community">Community</message>
	<message name="header.associations.Non-Profit">Non-Profit</message>
	<message name="header.associations.Religious">Religious</message>
	<message name="header.associations.Political">Political</message>
	<message name="header.associations.other">Other</message>

	<message name="month.long.01">January</message>
	<message name="month.long.02">February</message>
	<message name="month.long.03">March</message>
	<message name="month.long.04">April</message>
	<message name="month.long.05">May</message>
	<message name="month.long.06">June</message>
	<message name="month.long.07">July</message>
	<message name="month.long.08">August</message>
	<message name="month.long.09">September</message>
	<message name="month.long.10">October</message>
	<message name="month.long.11">November</message>
	<message name="month.long.12">December</message>

	<message name="month.short.01">Jan.</message>
	<message name="month.short.02">Feb.</message>
	<message name="month.short.03">Mar.</message>
	<message name="month.short.04">Apr.</message>
	<message name="month.short.05">May</message>
	<message name="month.short.06">June</message>
	<message name="month.short.07">July</message>
	<message name="month.short.08">Aug.</message>
	<message name="month.short.09">Sep.</message>
	<message name="month.short.10">Oct.</message>
	<message name="month.short.11">Nov.</message>
	<message name="month.short.12">Dec.</message>

	<message name="date.present">Present</message>

	<message name="telecomNumber.extension">ext.</message>
	<message name="mobile.smsEnabled">(SMS enabled)</message>

	<message name="contactMethod.PostalAddress">Address</message>
	<message name="contactMethod.Telephone">Telephone</message>
	<message name="contactMethod.Mobile">Mobile</message>
	<message name="contactMethod.Fax">Fax</message>
	<message name="contactMethod.Pager">Pager</message>
	<message name="contactMethod.TTYTDD">TTY/TDD</message>
	<message name="contactMethod.InternetEmailAddress">E-mail</message>
	<message name="contactMethod.InternetWebAddress">Website</message>
	<message name="contactMethod.POBox">P.O. Box</message>

	<message name="educationHistory.degreeIn">in</message>
	<message name="educationHistory.concentrationIn">Concentration in</message>
	<message name="educationHistory.highschool">Diploma</message>
	<message name="educationHistory.associates">Associate's degree</message>
	<message name="educationHistory.bachelors">Bachelor's degree</message>
	<message name="educationHistory.masters">Master's degree</message>
	<message name="educationHistory.doctorate">Ph.D.</message>
	<message name="educationHistory.international">Study abroad</message>
	<message name="educationHistory.expected">expected</message>

	<message name="licensesAndCertifications.validity">Validity</message>
	<message name="licensesAndCertifications.firstIssued">First issued</message>

	<message name="publicationHistory.volume">Volume</message>
	<message name="publicationHistory.issue">Issue</message>
	<message name="publicationHistory.pages">pg.</message>
	<message name="publicationHistory.chapter">Chapter</message>
	<message name="publicationHistory.role.editor">editor</message>
	<message name="publicationHistory.role.illustrator">illustrator</message>
	<message name="publicationHistory.role.contributor">contributor</message>

	<message name="and">and</message>
	<message name="notKnown">Unknown</message>
	<message name="notApplicable">N/A</message>

	<message name="languages.abilityTo">Ability to</message>
	<message name="languages.read">read</message>
	<message name="languages.write">write</message>
	<message name="languages.speak">speak</message>

	<message name="revisionDate">Last updated</message>

	<!-- ISO 3166 country codes, current as of 2006/06/21. -->
	<!-- http://www.iso.ch/iso/en/prods-services/iso3166ma/02iso-3166-code-lists/list-en1.html -->
	<!-- The names of some countries have been rearranged for display purposes. For instance, -->
	<!-- "Moldova, Republic of" was changed to "Republic of Moldova". Also, certain politically sensitive -->
	<!-- names have been left as stated in the ISO standard (e.g., Taiwan and the Palestinian Territory) in an attempt to avoid controversy. -->
	<message name="countryCode.AF">Afghanistan</message>
	<message name="countryCode.AX">Åland Islands</message>
	<message name="countryCode.AL">Albania</message>
	<message name="countryCode.DZ">Algeria</message>
	<message name="countryCode.AS">American Samoa</message>
	<message name="countryCode.AD">Andorra</message>
	<message name="countryCode.AO">Angola</message>
	<message name="countryCode.AI">Anguilla</message>
	<message name="countryCode.AQ">Antarctica</message>
	<message name="countryCode.AG">Antigua and Barbuda</message>
	<message name="countryCode.AR">Argentina</message>
	<message name="countryCode.AM">Armenia</message>
	<message name="countryCode.AW">Aruba</message>
	<message name="countryCode.AU">Australia</message>
	<message name="countryCode.AT">Austria</message>
	<message name="countryCode.AZ">Azerbaijan</message>
	<message name="countryCode.BS">Bahamas</message>
	<message name="countryCode.BH">Bahrain</message>
	<message name="countryCode.BD">Bangladesh</message>
	<message name="countryCode.BB">Barbados</message>
	<message name="countryCode.BY">Belarus</message>
	<message name="countryCode.BE">Belgium</message>
	<message name="countryCode.BZ">Belize</message>
	<message name="countryCode.BJ">Benin</message>
	<message name="countryCode.BM">Bermuda</message>
	<message name="countryCode.BT">Bhutan</message>
	<message name="countryCode.BO">Bolivia</message>
	<message name="countryCode.BA">Bosnia and Herzegovina</message>
	<message name="countryCode.BW">Botswana</message>
	<message name="countryCode.BV">Bouvet Island</message>
	<message name="countryCode.BR">Brazil</message>
	<message name="countryCode.IO">British Indian Ocean Territory</message>
	<message name="countryCode.BN">Brunei Darussalam</message>
	<message name="countryCode.BG">Bulgaria</message>
	<message name="countryCode.BF">Burkina Faso</message>
	<message name="countryCode.BI">Burundi</message>
	<message name="countryCode.KH">Cambodia</message>
	<message name="countryCode.CM">Cameroon</message>
	<message name="countryCode.CA">Canada</message>
	<message name="countryCode.CV">Cape Verde</message>
	<message name="countryCode.KY">Cayman Islands</message>
	<message name="countryCode.CF">Central African Republic</message>
	<message name="countryCode.TD">Chad</message>
	<message name="countryCode.CL">Chile</message>
	<message name="countryCode.CN">China</message>
	<message name="countryCode.CX">Christmas Island</message>
	<message name="countryCode.CC">Cocos (Keeling) Islands</message>
	<message name="countryCode.CO">Colombia</message>
	<message name="countryCode.KM">Comoros</message>
	<message name="countryCode.CG">Congo</message>
	<message name="countryCode.CD">The Democratic Republic of the Congo</message>
	<message name="countryCode.CK">Cook Islands</message>
	<message name="countryCode.CR">Costa Rica</message>
	<message name="countryCode.CI">Côte D'Ivoire</message>
	<message name="countryCode.HR">Croatia</message>
	<message name="countryCode.CU">Cuba</message>
	<message name="countryCode.CY">Cyprus</message>
	<message name="countryCode.CZ">Czech Republic</message>
	<message name="countryCode.DK">Denmark</message>
	<message name="countryCode.DJ">Djibouti</message>
	<message name="countryCode.DM">Dominica</message>
	<message name="countryCode.DO">Dominican Republic</message>
	<message name="countryCode.EC">Ecuador</message>
	<message name="countryCode.EG">Egypt</message>
	<message name="countryCode.SV">El Salvador</message>
	<message name="countryCode.GQ">Equatorial Guinea</message>
	<message name="countryCode.ER">Eritrea</message>
	<message name="countryCode.EE">Estonia</message>
	<message name="countryCode.ET">Ethiopia</message>
	<message name="countryCode.FK">Falkland Islands (Malvinas)</message>
	<message name="countryCode.FO">Faroe Islands</message>
	<message name="countryCode.FJ">Fiji</message>
	<message name="countryCode.FI">Finland</message>
	<message name="countryCode.FR">France</message>
	<message name="countryCode.GF">French Guiana</message>
	<message name="countryCode.PF">French Polynesia</message>
	<message name="countryCode.TF">French Southern Territories</message>
	<message name="countryCode.GA">Gabon</message>
	<message name="countryCode.GM">Gambia</message>
	<message name="countryCode.GE">Georgia</message>
	<message name="countryCode.DE">Germany</message>
	<message name="countryCode.GH">Ghana</message>
	<message name="countryCode.GI">Gibraltar</message>
	<message name="countryCode.GR">Greece</message>
	<message name="countryCode.GL">Greenland</message>
	<message name="countryCode.GD">Grenada</message>
	<message name="countryCode.GP">Guadeloupe</message>
	<message name="countryCode.GU">Guam</message>
	<message name="countryCode.GT">Guatemala</message>
	<message name="countryCode.GG">Guernsey</message>
	<message name="countryCode.GN">Guinea</message>
	<message name="countryCode.GW">Guinea-Bissau</message>
	<message name="countryCode.GY">Guyana</message>
	<message name="countryCode.HT">Haiti</message>
	<message name="countryCode.HM">Heard Island and McDonald Islands</message>
	<message name="countryCode.VA">Holy See (Vatican City State)</message>
	<message name="countryCode.HN">Honduras</message>
	<message name="countryCode.HK">Hong Kong</message>
	<message name="countryCode.HU">Hungary</message>
	<message name="countryCode.IS">Iceland</message>
	<message name="countryCode.IN">India</message>
	<message name="countryCode.ID">Indonesia</message>
	<message name="countryCode.IR">Islamic Republic of Iran</message>
	<message name="countryCode.IQ">Iraq</message>
	<message name="countryCode.IE">Ireland</message>
	<message name="countryCode.IM">Isle of Man</message>
	<message name="countryCode.IL">Israel</message>
	<message name="countryCode.IT">Italy</message>
	<message name="countryCode.JM">Jamaica</message>
	<message name="countryCode.JP">Japan</message>
	<message name="countryCode.JE">Jersey</message>
	<message name="countryCode.JO">Jordan</message>
	<message name="countryCode.KZ">Kazakhstan</message>
	<message name="countryCode.KE">Kenya</message>
	<message name="countryCode.KI">Kiribati</message>
	<message name="countryCode.KP">Democratic People's Republic of Korea</message>
	<message name="countryCode.KR">Republic of Korea</message>
	<message name="countryCode.KW">Kuwait</message>
	<message name="countryCode.KG">Kyrgyzstan</message>
	<message name="countryCode.LA">Lao People's Democratic Republic</message>
	<message name="countryCode.LV">Latvia</message>
	<message name="countryCode.LB">Lebanon</message>
	<message name="countryCode.LS">Lesotho</message>
	<message name="countryCode.LR">Liberia</message>
	<message name="countryCode.LY">Libyan Arab Jamahiriya</message>
	<message name="countryCode.LI">Liechtenstein</message>
	<message name="countryCode.LT">Lithuania</message>
	<message name="countryCode.LU">Luxembourg</message>
	<message name="countryCode.MO">Macao</message>
	<message name="countryCode.MK">The Former Yugoslav Republic of Macedonia</message>
	<message name="countryCode.MG">Madagascar</message>
	<message name="countryCode.MW">Malawi</message>
	<message name="countryCode.MY">Malaysia</message>
	<message name="countryCode.MV">Maldives</message>
	<message name="countryCode.ML">Mali</message>
	<message name="countryCode.MT">Malta</message>
	<message name="countryCode.MH">Marshall Islands</message>
	<message name="countryCode.MQ">Martinique</message>
	<message name="countryCode.MR">Mauritania</message>
	<message name="countryCode.MU">Mauritius</message>
	<message name="countryCode.YT">Mayotte</message>
	<message name="countryCode.MX">Mexico</message>
	<message name="countryCode.FM">Federated States of Micronesia</message>
	<message name="countryCode.MD">Republic of Moldova</message>
	<message name="countryCode.MC">Monaco</message>
	<message name="countryCode.MN">Mongolia</message>
	<message name="countryCode.MS">Montserrat</message>
	<message name="countryCode.MA">Morocco</message>
	<message name="countryCode.MZ">Mozambique</message>
	<message name="countryCode.MM">Myanmar</message>
	<message name="countryCode.NA">Namibia</message>
	<message name="countryCode.NR">Nauru</message>
	<message name="countryCode.NP">Nepal</message>
	<message name="countryCode.NL">Netherlands</message>
	<message name="countryCode.AN">Netherlands Antilles</message>
	<message name="countryCode.NC">New Caledonia</message>
	<message name="countryCode.NZ">New Zealand</message>
	<message name="countryCode.NI">Nicaragua</message>
	<message name="countryCode.NE">Niger</message>
	<message name="countryCode.NG">Nigeria</message>
	<message name="countryCode.NU">Niue</message>
	<message name="countryCode.NF">Norfolk Island</message>
	<message name="countryCode.MP">Northern Mariana Islands</message>
	<message name="countryCode.NO">Norway</message>
	<message name="countryCode.OM">Oman</message>
	<message name="countryCode.PK">Pakistan</message>
	<message name="countryCode.PW">Palau</message>
	<message name="countryCode.PS">Palestinian Territory, Occupied</message>
	<message name="countryCode.PA">Panama</message>
	<message name="countryCode.PG">Papua New Guinea</message>
	<message name="countryCode.PY">Paraguay</message>
	<message name="countryCode.PE">Peru</message>
	<message name="countryCode.PH">Philippines</message>
	<message name="countryCode.PN">Pitcairn</message>
	<message name="countryCode.PL">Poland</message>
	<message name="countryCode.PT">Portugal</message>
	<message name="countryCode.PR">Puerto Rico</message>
	<message name="countryCode.QA">Qatar</message>
	<message name="countryCode.RE">Réunion</message>
	<message name="countryCode.RO">Romania</message>
	<message name="countryCode.RU">Russian Federation</message>
	<message name="countryCode.RW">Rwanda</message>
	<message name="countryCode.SH">Saint Helena</message>
	<message name="countryCode.KN">Saint Kitts and Nevis</message>
	<message name="countryCode.LC">Saint Lucia</message>
	<message name="countryCode.PM">Saint Pierre and Miquelon</message>
	<message name="countryCode.VC">Saint Vincent and the Grenadines</message>
	<message name="countryCode.WS">Samoa</message>
	<message name="countryCode.SM">San Marino</message>
	<message name="countryCode.ST">Sao Tome and Principe</message>
	<message name="countryCode.SA">Saudi Arabia</message>
	<message name="countryCode.SN">Senegal</message>
	<message name="countryCode.CS">Serbia and Montenegro</message>
	<message name="countryCode.SC">Seychelles</message>
	<message name="countryCode.SL">Sierra Leone</message>
	<message name="countryCode.SG">Singapore</message>
	<message name="countryCode.SK">Slovakia</message>
	<message name="countryCode.SI">Slovenia</message>
	<message name="countryCode.SB">Solomon Islands</message>
	<message name="countryCode.SO">Somalia</message>
	<message name="countryCode.ZA">South Africa</message>
	<message name="countryCode.GS">South Georgia and the South Sandwich Islands</message>
	<message name="countryCode.ES">Spain</message>
	<message name="countryCode.LK">Sri Lanka</message>
	<message name="countryCode.SD">Sudan</message>
	<message name="countryCode.SR">Suriname</message>
	<message name="countryCode.SJ">Svalbard and Jan Mayen</message>
	<message name="countryCode.SZ">Swaziland</message>
	<message name="countryCode.SE">Sweden</message>
	<message name="countryCode.CH">Switzerland</message>
	<message name="countryCode.SY">Syrian Arab Republic</message>
	<message name="countryCode.TW">Taiwan, Province of China</message>
	<message name="countryCode.TJ">Tajikistan</message>
	<message name="countryCode.TZ">United Republic of Tanzania</message>
	<message name="countryCode.TH">Thailand</message>
	<message name="countryCode.TL">Timor-Leste</message>
	<message name="countryCode.TG">Togo</message>
	<message name="countryCode.TK">Tokelau</message>
	<message name="countryCode.TO">Tonga</message>
	<message name="countryCode.TT">Trinidad and Tobago</message>
	<message name="countryCode.TN">Tunisia</message>
	<message name="countryCode.TR">Turkey</message>
	<message name="countryCode.TM">Turkmenistan</message>
	<message name="countryCode.TC">Turks and Caicos Islands</message>
	<message name="countryCode.TV">Tuvalu</message>
	<message name="countryCode.UG">Uganda</message>
	<message name="countryCode.UA">Ukraine</message>
	<message name="countryCode.AE">United Arab Emirates</message>
	<message name="countryCode.GB">United Kingdom</message>
	<message name="countryCode.US">United States</message>
	<message name="countryCode.UM">United States Minor Outlying Islands</message>
	<message name="countryCode.UY">Uruguay</message>
	<message name="countryCode.UZ">Uzbekistan</message>
	<message name="countryCode.VU">Vanuatu</message>
	<message name="countryCode.VE">Venezuela</message>
	<message name="countryCode.VN">Viet Nam</message>
	<message name="countryCode.VG">British Virgin Islands</message>
	<message name="countryCode.VI">U.S. Virgin Islands</message>
	<message name="countryCode.WF">Wallis and Futuna</message>
	<message name="countryCode.EH">Western Sahara</message>
	<message name="countryCode.YE">Yemen</message>
	<message name="countryCode.ZM">Zambia</message>
	<message name="countryCode.ZW">Zimbabwe</message>

	<!-- ISO 639-1 language codes, current as of 2006/06/21 -->
	<!-- http://www.loc.gov/standards/iso639-2/langcodes.html -->
	<!-- Note: For codes that map to multiple languages (e.g., ES = Spanish; Castilian), -->
	<!-- only the first mapping (e.g., Spanish) is given. Likewise, any explanatory text -->
	<!-- is removed (e.g., "Greek, Modern (1453-)" was changed to "Greek") and modifiers -->
	<!-- are rearranged (e.g., "Sotho, Southern" becomes "Southern Sotho") -->
	<message name="language.AA">Afar</message>
	<message name="language.AB">Abkhazian</message>
	<message name="language.AE">Avestan</message>
	<message name="language.AF">Afrikaans</message>
	<message name="language.AK">Akan</message>
	<message name="language.AM">Amharic</message>
	<message name="language.AN">Aragonese</message>
	<message name="language.AR">Arabic</message>
	<message name="language.AS">Assamese</message>
	<message name="language.AV">Avaric</message>
	<message name="language.AY">Aymara</message>
	<message name="language.AZ">Azerbaijani</message>
	<message name="language.BA">Bashkir</message>
	<message name="language.BE">Belarusian</message>
	<message name="language.BG">Bulgarian</message>
	<message name="language.BH">Bihari</message>
	<message name="language.BI">Bislama</message>
	<message name="language.BM">Bambara</message>
	<message name="language.BN">Bengali</message>
	<message name="language.BO">Tibetan</message>
	<message name="language.BR">Breton</message>
	<message name="language.BS">Bosnian</message>
	<message name="language.CA">Catalan</message>
	<message name="language.CE">Chechen</message>
	<message name="language.CH">Chamorro</message>
	<message name="language.CO">Corsican</message>
	<message name="language.CR">Cree</message>
	<message name="language.CS">Czech</message>
	<message name="language.CU">Slavic</message>
	<message name="language.CV">Chuvash</message>
	<message name="language.CY">Welsh</message>
	<message name="language.DA">Danish</message>
	<message name="language.DE">German</message>
	<message name="language.DV">Divehi</message>
	<message name="language.DZ">Dzongkha</message>
	<message name="language.EE">Ewe</message>
	<message name="language.EL">Greek</message>
	<message name="language.EN">English</message>
	<message name="language.EO">Esperanto</message>
	<message name="language.ES">Spanish</message>
	<message name="language.ET">Estonian</message>
	<message name="language.EU">Basque</message>
	<message name="language.FA">Persian</message>
	<message name="language.FF">Fulah</message>
	<message name="language.FI">Finnish</message>
	<message name="language.FJ">Fijian</message>
	<message name="language.FO">Faroese</message>
	<message name="language.FR">French</message>
	<message name="language.FY">Western Frisian</message>
	<message name="language.GA">Irish</message>
	<message name="language.GD">Gaelic</message>
	<message name="language.GL">Galician</message>
	<message name="language.GN">Guarani</message>
	<message name="language.GU">Gujarati</message>
	<message name="language.GV">Manx</message>
	<message name="language.HA">Hausa</message>
	<message name="language.HE">Hebrew</message>
	<message name="language.HI">Hindi</message>
	<message name="language.HO">Hiri Motu</message>
	<message name="language.HR">Croatian</message>
	<message name="language.HT">Haitian</message>
	<message name="language.HU">Hungarian</message>
	<message name="language.HY">Armenian</message>
	<message name="language.HZ">Herero</message>
	<message name="language.IA">Interlingua</message>
	<message name="language.ID">Indonesian</message>
	<message name="language.IE">Interlingue</message>
	<message name="language.IG">Igbo</message>
	<message name="language.II">Sichuan Yi</message>
	<message name="language.IK">Inupiaq</message>
	<message name="language.IO">Ido</message>
	<message name="language.IS">Icelandic</message>
	<message name="language.IT">Italian</message>
	<message name="language.IU">Inuktitut</message>
	<message name="language.JA">Japanese</message>
	<message name="language.JV">Javanese</message>
	<message name="language.KA">Georgian</message>
	<message name="language.KG">Kongo</message>
	<message name="language.KI">Kikuyu</message>
	<message name="language.KJ">Kuanyama</message>
	<message name="language.KK">Kazakh</message>
	<message name="language.KL">Kalaallisut</message>
	<message name="language.KM">Khmer</message>
	<message name="language.KN">Kannada</message>
	<message name="language.KO">Korean</message>
	<message name="language.KR">Kanuri</message>
	<message name="language.KS">Kashmiri</message>
	<message name="language.KU">Kurdish</message>
	<message name="language.KV">Komi</message>
	<message name="language.KW">Cornish</message>
	<message name="language.KY">Kirghiz</message>
	<message name="language.LA">Latin</message>
	<message name="language.LB">Luxembourgish</message>
	<message name="language.LG">Ganda</message>
	<message name="language.LI">Limburgan</message>
	<message name="language.LN">Lingala</message>
	<message name="language.LO">Lao</message>
	<message name="language.LT">Lithuanian</message>
	<message name="language.LU">Luba-Katanga</message>
	<message name="language.LV">Latvian</message>
	<message name="language.MG">Malagasy</message>
	<message name="language.MH">Marshallese</message>
	<message name="language.MI">Maori</message>
	<message name="language.MK">Macedonian</message>
	<message name="language.ML">Malayalam</message>
	<message name="language.MN">Mongolian</message>
	<message name="language.MO">Moldavian</message>
	<message name="language.MR">Marathi</message>
	<message name="language.MS">Malay</message>
	<message name="language.MT">Maltese</message>
	<message name="language.MY">Burmese</message>
	<message name="language.NA">Nauru</message>
	<message name="language.NB">Norwegian Bokmål</message>
	<message name="language.ND">North Ndebele</message>
	<message name="language.NE">Nepali</message>
	<message name="language.NG">Ndonga</message>
	<message name="language.NL">Dutch</message>
	<message name="language.NN">Norwegian Nynorsk</message>
	<message name="language.NO">Norwegian</message>
	<message name="language.NR">South Ndebele</message>
	<message name="language.NV">Navajo</message>
	<message name="language.NY">Chichewa</message>
	<message name="language.OC">Occitan</message>
	<message name="language.OJ">Ojibwa</message>
	<message name="language.OM">Oromo</message>
	<message name="language.OR">Oriya</message>
	<message name="language.OS">Ossetian</message>
	<message name="language.PA">Panjabi</message>
	<message name="language.PI">Pali</message>
	<message name="language.PL">Polish</message>
	<message name="language.PS">Pushto</message>
	<message name="language.PT">Portuguese</message>
	<message name="language.QU">Quechua</message>
	<message name="language.RM">Raeto-Romance</message>
	<message name="language.RN">Rundi</message>
	<message name="language.RO">Romanian</message>
	<message name="language.RU">Russian</message>
	<message name="language.RW">Kinyarwanda</message>
	<message name="language.SA">Sanskrit</message>
	<message name="language.SC">Sardinian</message>
	<message name="language.SD">Sindhi</message>
	<message name="language.SE">Northern Sami</message>
	<message name="language.SG">Sango</message>
	<message name="language.SI">Sinhala</message>
	<message name="language.SK">Slovak</message>
	<message name="language.SL">Slovenian</message>
	<message name="language.SM">Samoan</message>
	<message name="language.SN">Shona</message>
	<message name="language.SO">Somali</message>
	<message name="language.SQ">Albanian</message>
	<message name="language.SR">Serbian</message>
	<message name="language.SS">Swati</message>
	<message name="language.ST">Southern Sotho</message>
	<message name="language.SU">Sundanese</message>
	<message name="language.SV">Swedish</message>
	<message name="language.SW">Swahili</message>
	<message name="language.TA">Tamil</message>
	<message name="language.TE">Telugu</message>
	<message name="language.TG">Tajik</message>
	<message name="language.TH">Thai</message>
	<message name="language.TI">Tigrinya</message>
	<message name="language.TK">Turkmen</message>
	<message name="language.TL">Tagalog</message>
	<message name="language.TN">Tswana</message>
	<message name="language.TO">Tonga</message>
	<message name="language.TR">Turkish</message>
	<message name="language.TS">Tsonga</message>
	<message name="language.TT">Tatar</message>
	<message name="language.TW">Twi</message>
	<message name="language.TY">Tahitian</message>
	<message name="language.UG">Uighur</message>
	<message name="language.UK">Ukrainian</message>
	<message name="language.UR">Urdu</message>
	<message name="language.UZ">Uzbek</message>
	<message name="language.VE">Venda</message>
	<message name="language.VI">Vietnamese</message>
	<message name="language.VO">Volapük</message>
	<message name="language.WA">Walloon</message>
	<message name="language.WO">Wolof</message>
	<message name="language.XH">Xhosa</message>
	<message name="language.YI">Yiddish</message>
	<message name="language.YO">Yoruba</message>
	<message name="language.ZA">Zhuang</message>
	<message name="language.ZH">Chinese</message>
	<message name="language.ZU">Zulu</message>

</messages>


text:
unified_mode true

property :info_allow_list, [String, Array],
         default: %w(127.0.0.1 ::1),
         description: ''

action :create do
  template ::File.join(apache_dir, 'mods-available', 'info.conf') do
    source 'mods/info.conf.erb'
    cookbook 'apache2'
    variables(info_allow_list: Array(new_resource.info_allow_list))
  end
end

action_class do
  include Apache2::Cookbook::Helpers
end


text:
<!--
    Google News API for SEC Tool
    BKJ for Phronesis
    Propriety Code, may not be used w/o explicit permission of creators
-->
<script>
  (function() {
    var cx     = '008243922040576696960:zngc3pg5bka';
    var gcse   = document.createElement('script');
    gcse.type  = 'text/javascript';
    gcse.async = true;
    gcse.src   = 'http://www.google.com/cse/cse.js?cx=' + cx;
    var s      = document.getElementsByTagName('script')[0];
    s.parentNode.insertBefore(gcse, s);
  })();
</script>
<gcse:searchresults-only></gcse:searchresults-only>


text:
package in.lineofcode.xml;
/**
 *
 * @author Gaurav Rai Mazra
 *
 */

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;

import org.junit.jupiter.api.Test;

public class XmlBuilderTests {
	@Test
	public void testGetUsersXml()
	{
		XmlBuilder xmlBuilder = new XmlBuilder("Users");
		assertNotNull(xmlBuilder.toXml());
		assertEquals("<Users></Users>", xmlBuilder.toXml());
	}

	@Test
	public void testGetUserXml()
	{
		XmlBuilder xmlBuilder = new XmlBuilder("User");
		assertNotNull(xmlBuilder.toXml());
		assertEquals("<User></User>", xmlBuilder.toXml());
	}

	@Test
	public void testGetUsersXmlWithChildren()
	{
		XmlBuilder xmlBuilder = new XmlBuilder("Users");
		xmlBuilder.addChildren(new XmlBuilder("User"));
		assertEquals("<Users><User></User></Users>", xmlBuilder .toXml());
	}

	@Test
	public void testGetUserXmlWithAttributes()
	{
		XmlBuilder xmlBuilder = new XmlBuilder("User");
		xmlBuilder.addAttribute("active", "true");
		assertEquals("<User active=\"true\"></User>", xmlBuilder .toXml());
	}
}


text:
<!DOCTYPE html>
<!--
Copyright 2013 Mozilla Foundation

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<html>
  <head>
    <meta charset="utf-8">
    <title>Shumway Inspector Player</title>
  </head>
  <body>

    <script>
      window.print = function (msg) {
        console.log.apply(console, arguments);
      };
    </script>

    <!-- Autogenerated player references: base=../../ -->
    <script> console.time("Load Player Dependencies"); </script>

    <script> console.time("Load Shared Dependencies"); </script>

    <script src="../../build/version/version.js"></script>
    <script src="../../build/ts/base.js"></script>
    <script src="../../build/ts/tools.js"></script>

    <script> console.timeEnd("Load Shared Dependencies"); </script>

    <script> console.time("Load AVM2 Dependencies"); </script>
    <script src="../../build/libs/relooper.js"></script>
    <script src="../../build/ts/avm2.js"></script>
    <script> console.timeEnd("Load AVM2 Dependencies"); </script>

    <script> console.time("Load SWF Parser"); </script>
    <script src="../../build/ts/swf.js"></script>
    <script> console.timeEnd("Load SWF Parser"); </script>

    <!-- !inline console.time("Load Compiled Code Cache"); -->
    <!-- !inline console.timeEnd("Load Compiled Code Cache"); -->

    <!-- Load Flash TS Dependencies -->
    <script> console.time("Load Flash TS Dependencies"); </script>
    <script src="../../build/ts/flash.js"></script>
    <script> console.timeEnd("Load Flash TS Dependencies"); </script>

    <!-- Load AVM1 Dependencies -->
    <script> console.time("Load AVM1 Dependencies"); </script>
    <script src="../../build/ts/avm1.js"></script>
    <script> console.timeEnd("Load AVM1 Dependencies"); </script>

    <script src="../../build/ts/gfx-base.js"></script>
    <script src="../../build/ts/player.js"></script>

    <script> console.timeEnd("Load Player Dependencies"); </script>

    <!-- Autogenerated player references end -->

    <script src="js/inspectorPlayer.js"></script>
    <script src="js/inspectorFlashlog.js"></script>
    <script src="js/inspectorMocks.js"></script>

    <script>
      SHUMWAY_ROOT = "../../src/";
    </script>

  </body>
</html>


text:
<?php

// namespace Facebook\GraphNodes;

/**
 * Class GraphGroup
 *
 * @package Facebook
 */
class GraphGroup extends GraphNode
{
    /**
     * @var array Maps object key names to GraphNode types.
     */
    protected static $graphObjectMap = [
        'cover' => '\Facebook\GraphNodes\GraphCoverPhoto',
        'venue' => '\Facebook\GraphNodes\GraphLocation',
    ];

    /**
     * Returns the `id` (The Group ID) as string if present.
     *
     * @return string|null
     */
    public function getId()
    {
        return $this->getField('id');
    }

    /**
     * Returns the `cover` (The cover photo of the Group) as GraphCoverPhoto if present.
     *
     * @return GraphCoverPhoto|null
     */
    public function getCover()
    {
        return $this->getField('cover');
    }

    /**
     * Returns the `description` (A brief description of the Group) as string if present.
     *
     * @return string|null
     */
    public function getDescription()
    {
        return $this->getField('description');
    }

    /**
     * Returns the `email` (The email address to upload content to the Group. Only current members of the Group can use this) as string if present.
     *
     * @return string|null
     */
    public function getEmail()
    {
        return $this->getField('email');
    }

    /**
     * Returns the `icon` (The URL for the Group's icon) as string if present.
     *
     * @return string|null
     */
    public function getIcon()
    {
        return $this->getField('icon');
    }

    /**
     * Returns the `link` (The Group's website) as string if present.
     *
     * @return string|null
     */
    public function getLink()
    {
        return $this->getField('link');
    }

    /**
     * Returns the `name` (The name of the Group) as string if present.
     *
     * @return string|null
     */
    public function getName()
    {
        return $this->getField('name');
    }

    /**
     * Returns the `member_request_count` (Number of people asking to join the group.) as int if present.
     *
     * @return int|null
     */
    public function getMemberRequestCount()
    {
        return $this->getField('member_request_count');
    }

    /**
     * Returns the `owner` (The profile that created this Group) as GraphNode if present.
     *
     * @return GraphNode|null
     */
    public function getOwner()
    {
        return $this->getField('owner');
    }

    /**
     * Returns the `parent` (The parent Group of this Group, if it exists) as GraphNode if present.
     *
     * @return GraphNode|null
     */
    public function getParent()
    {
        return $this->getField('parent');
    }

    /**
     * Returns the `privacy` (The privacy setting of the Group) as string if present.
     *
     * @return string|null
     */
    public function getPrivacy()
    {
        return $this->getField('privacy');
    }

    /**
     * Returns the `updated_time` (The last time the Group was updated (this includes changes in the Group's properties and changes in posts and comments if user can see them)) as \DateTime if present.
     *
     * @return \DateTime|null
     */
    public function getUpdatedTime()
    {
        return $this->getField('updated_time');
    }

    /**
     * Returns the `venue` (The location for the Group) as GraphLocation if present.
     *
     * @return GraphLocation|null
     */
    public function getVenue()
    {
        return $this->getField('venue');
    }
}


text:
var Tabs = {
    init: function( options, elem ) {
        this.options = $.extend( {}, this.options, options );
        this.elem  = elem;
        this.element = $(elem);
        this._targets = [];

        this._setOptionsFromDOM();
        this._create();

        Utils.exec(this.options.onTabsCreate, [this.element]);

        return this;
    },

    options: {
        onTab: Metro.noop,
        onBeforeTab: Metro.noop_true,
        onTabsCreate: Metro.noop
    },

    _setOptionsFromDOM: function(){
        var that = this, element = this.element, o = this.options;

        $.each(element.data(), function(key, value){
            if (key in o) {
                try {
                    o[key] = JSON.parse(value);
                } catch (e) {
                    o[key] = value;
                }
            }
        });
    },

    _create: function(){
        var that = this, element = this.element, o = this.options;
        var prev = element.prev();
        var parent = element.parent();
        var container = $("
").addClass("tabs tabs-wrapper " + element[0].className);
        var expandButton, expandTitle;

        element[0].className = "";

        if (prev.length === 0) {
            parent.prepend(container);
        } else {
            container.insertAfter(prev);
        }

        element.appendTo(container);

        element.data('expanded', false);

        expandTitle = $("
").addClass("expand-title"); container.prepend(expandTitle);
        expandButton = $("").addClass("expand-button").html(""); container.append(expandButton);

        container.on(Metro.events.click, ".expand-button, .expand-title", function(){
            if (element.data('expanded') === false) {
                element.addClass("expand");
                element.data('expanded', true);
            } else {
                element.removeClass("expand");
                element.data('expanded', false);
            }
        });

        element.on(Metro.events.click, "a", function(e){
            var link = $(this);
            var tab = link.parent("li");

            if (element.data('expanded') === true) {
                element.removeClass("expand");
                element.data('expanded', false);
            }
            if (Utils.exec(o.onBeforeTab, [tab, element]) === true) that._open(tab);
            e.preventDefault();
        });

        this._open();
    },

    _collectTargets: function(){
        var that = this, element = this.element;
        var tabs = element.find("li");

        $.each(tabs, function(){
            var target = $(this).find("a").attr("href");
            if (target && target !== "#") {
                that._targets.push(target);
            }
        });
    },

    _open: function(tab){
        var that = this, element = this.element, o = this.options;
        var tabs = element.find("li");
        var expandTitle = element.siblings(".expand-title");

        if (tabs.length === 0) {
            return;
        }

        this._collectTargets();

        if (tab === undefined) {
            tab = $(tabs[0]);
        }

        var target = tab.find("a").attr("href");

        if (target === undefined) {
            return;
        }

        tabs.removeClass("active");
        if (tab.parent().hasClass("d-menu")) {
            tab.parent().parent().addClass("active");
        } else {
            tab.addClass("active");
        }

        $.each(this._targets, function(){
            $(this).hide();
        });

        if (target !== "#") {
            $(target).show();
        }

        expandTitle.html(tab.find("a").html());

        Utils.exec(o.onTab, [tab, element]);
    },

    changeAttribute: function(attributeName){

    }
};

Metro.plugin('tabs', Tabs);


text:
* Removes velocity:source-map-support dependency
  It breaks file links in Chrome for stack traces.

## v0.10.9

* Improves mirror caching
  * New mirrors now get the complete hot cache of the app.
    -> Same start speed for mirrors as for the already cached app.
  * Mirrors are cached in .meteor/local/mirrors.
    -> Mirrors never need to be built from scratch after the first start.
       This is also nice for CI mirror caching.
       Just cache `.meteor/local/mirrors`, and you get cached mirrors on CI.

## v0.10.8

* Update for Meteor 1.2.1

## v0.10.7

* Adds extra logging to mirror starting

## v0.10.6

* Adds Velocity.startup to mirrors

## v0.10.5

* Fixes debugging with Webstorm

## v0.10.4

* Removes deprecated CI logic

## v0.10.3

* Runs mirror with --once flag on CI

## v0.10.2

* Performance improvements
* A way to specify a different Meteor release for mirrors
  See: https://velocity.readme.io/v1.0/docs/use-with-older-meteor-release

## v0.10.1

* Use Meteor 1.2.0.2 for mirrors

## v0.10.0

* Compatibility with Meteor 1.2

## v0.9.3

* Reverts breaking change from velocity:METEOR
  (.meteor/packages file was no longer available in the mirror folder)

## v0.9.2

* Updates Velocity Meteor command line tool and some packages.
  This fixes some edge case issues and improves error logging in CI.

## v0.9.1

* Source maps support for server stack traces

## v0.9.0

* Source maps support for client stack traces

## v0.8.0

* Support for remote databases and multiple apps running at the same time
  ([Documentation](https://velocity.readme.io/docs/use-different-mongodb-server))

## v0.7.1

* Added Function.bind polyfill for PhantomJS

## v0.7.0

* Parallel execution support

## v0.6.4

* Fix for windows paths

## v0.6.3

* Don't print errors when a test frameworks hasn't implemented the experimental lifecycle hooks.
* Unblock longer running Velocity method calls for improved performance.

## v0.6.2

* Fixes performance issue when you have node_modules in your tests folder.
* Use velocity:METEOR@1.1.0.2_3 to spawn mirrors.

## v0.6.1

* Remove terminated mirrors from previous runs.
  Fixes that `meteor --test` is not exiting after first run.

## v0.6.0

* Support for Windows
* Improved mirrors
* Debugging mirrors

Make sure you read https://github.com/meteor-velocity/velocity/wiki/Changes-in-0.6.0.

## v0.5.1

* Prototype of testing lifecycle (run, reset, etc.)

## v0.5.0

* First cut of distributable support
* Removed default port of 5000 for mirrors and replaced with freeport.
* Fixed client side error with VELOCITY enabling

## v0.4.6

* Mirror initializing and being ready are now part of the explicit logs so that users are aware
of the existence of mirrors.

## v0.4.5

* Removed mirrorId and replaced with framework name. If frameworks wish to use multiple mirrors,
they can manage this themselves

## v0.4.4

* Fixed mirror killing mechanism in node-soft-mirror by removing idomptency logic into mirror
implementation
* Increased logging around mirror start/ready

## v0.4.3

* Fixes connection errors with old mirrors (#195)

## v0.4.2

* Adds missing checks to pass audit-argument-checks

## v0.4.1

* decoupled mirrors
* added Velocity.startup
* Decoupled mirrors from the core so now mirrors can be authored as packages
* Updated chokidar and now file watching only synced once

## v0.3.2

* Makes FileCopier more robust

## v0.3.0

* temporarily move off of rc track while issue https://github.com/meteor/meteor/issues/3147 is resolved

## v1.0.0.rc.6

* Decoupled mirrors from the core so now mirrors can be authored as packages
* Updated chokidar and now file watching only synced once

## v1.0.0.rc.5
??

## v1.0.0.rc.4

* Fixed bug in de-bouncing rsync
* Added NPM shrink
* Bumped npm dependency versions for chokadir, glob and freeport
* Increased mirror logging

## v1.0.0.rc.3

* Mirror output is now visible by default
* Mirrors now use DDP to notify frameworks of up-ness
* Fixed mirror dying on server restarts (YAY!)

## v1.0.0.rc.2
???

## v1.0.0.rc.1

* Updated to use Meteor 1.0
* mirror is disabled by default

### For Velocity plugin developers
* Rewrite mirroring approach
  * Mirrors no longer startup by default and have to be requested by frameworks using requestMirror
  * requestMirror now checks for existing mirrors by port and reuses them if they already exist
  * velocityMirrors can contain multiple entries even if the entries share the same port
  * frameworks can provide rootUrl when requesting mirrors
  *

## v0.2.0

* Support for Meteor >= 0.9.1

### For Velocity plugin developers

* Added Velocity.registerTestingFramework as the new preferred way to register
  the testing framework to Velocity.

## v0.1.20

### For Velocity plugin developers

* velocityIsMirror now available as a Meteor method for clients to know where they are running
* Fixtures added through _addFixtures are now copied to the mirror
* Added a VelocityMirrors collection that contains mirror metadata
* Added preProcessors that run after an rsync but before starting a mirror
* Added postProcessors which run after all frameworks have finished

## v0.1.19

* add option to FileCopier to control when files are copied

## v0.1.18

* Improved error handling when the mirror cannot be started.
  Velocity will retry to start the mirror for 10 seconds before an error is shown.

## v0.1.17

* The mirror urls are now based on the parent ROOT_URL and MONGO_URL
* Velocity will now output the mirror log when the environment variable
  `VELOCITY_DEBUG_MIRROR` is set to a truey value

## v0.1.16

* FileCopier: Updated fs-extra dependency

## v0.1.15

* optimize searching for test packages
* FileCopier: Correctly handle when a file already exists in the mirror

## v0.1.12

* Passes audit-argument-checks now

### For Velocity plugin developers

* Added API for requesting mirrors
* Added API for resetting the database of the mirror
* Added FileCopier utility that can be used for copying test files into the mirror
* Added Velocity.getMirrorPath for getting the absolute mirror directoy path
* Added Velocity.getTestsPath for getting the absolute tests directory path

## v0.1.11

* remove example submodule; instruct how to use external repo instead
* update repo so users can ref velocity repo directly in smart.json

## v0.1.10

* Remove ref to unused mirror package

## v0.1.9

* Add copySampleTests Meteor method
* Use rsync mirroring
* Removed HTML reporter from

## v0.1.8

* Erroneous release!

## v0.1.7

Added show/hide visibility toggle for every each report section with browser
state persistence using amplify

## v0.1.6

Frameworks can now let Velocity know when they are complete,
and the results will update on the UI.

## v0.1.5

Fix for report overlay when used in conjunction with accounts-*

## v0.1.4

Auto-detect velocity-compatible packages via `testPackages:true` in their smart.json files.

## v0.1.3

Murky ancient history...