<commit_before><?php
/**
 * This file is part of the LdapTools package.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace spec\LdapTools\AttributeConverter;

use LdapTools\AttributeConverter\AttributeConverterInterface;
use LdapTools\BatchModify\Batch;
use LdapTools\Connection\LdapConnectionInterface;
use PhpSpec\ObjectBehavior;
use Prophecy\Argument;

class ConvertExchangeProxyAddressSpec extends ObjectBehavior
{
    protected $connection;

    protected $expectedSearch = [
        '(&(distinguishedName=\63\6e\3d\66\6f\6f\2c\64\63\3d\66\6f\6f\2c\64\63\3d\62\61\72))',
        ['proxyAddresses'],
        null,
        "subtree",
        null,
    ];

    protected $expectedResult = [
        'count' => 1,
        0 => [
            'proxyAddresses' => [
                'count' => 3,
                0 => "smtp:<EMAIL>",
                1 => "SMTP:Foo.Bar@foo.bar",
                2 => "x400:foo",
            ],
            'count' => 2,
            'dn' => "CN=foo,DC=foo,DC=bar",
        ],
    ];

    function let(LdapConnectionInterface $connection)
    {
        $this->connection = $connection;
        $options = [
            'addressType' => [
                'exchangeSmtpAddress' => 'smtp',
                'exchangeDefaultSmtpAddress' => 'smtp',
            ],
            'default' => [
                'exchangeDefaultSmtpAddress'
            ],
        ];
        $this->setOptions($options);
        $this->setLdapConnection($connection);
        $this->setDn('cn=foo,dc=foo,dc=bar');
    }

    function it_is_initializable()
    {
        $this->shouldHaveType('LdapTools\AttributeConverter\ConvertExchangeProxyAddress');
    }

    function it_should_convert_an_array_of_addresses_to_an_array_of_specific_address_types()
    {
        $smtp = ['<EMAIL>','<EMAIL>'];
        $this->setAttribute('exchangeSmtpAddress');
        // 514 represents a "normal account" with the disabled bit set.
        $this->fromLdap(['smtp:<EMAIL>','SMTP:<EMAIL>','x400:foo'])->shouldBeEqualTo($smtp);<commit_msg>Add a missing interface check to a spec.<commit_after><?php
/**
 * This file is part of the LdapTools package.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace spec\LdapTools\AttributeConverter;

use LdapTools\AttributeConverter\AttributeConverterInterface;
use LdapTools\BatchModify\Batch;
use LdapTools\Connection\LdapConnectionInterface;
use PhpSpec\ObjectBehavior;
use Prophecy\Argument;

class ConvertExchangeProxyAddressSpec extends ObjectBehavior
{
    protected $connection;

    protected $expectedSearch = [
        '(&(distinguishedName=\63\6e\3d\66\6f\6f\2c\64\63\3d\66\6f\6f\2c\64\63\3d\62\61\72))',
        ['proxyAddresses'],
        null,
        "subtree",
        null,
    ];

    protected $expectedResult = [
        'count' => 1,
        0 => [
            'proxyAddresses' => [
                'count' => 3,
                0 => "smtp:<EMAIL>",
                1 => "SMTP:Foo.Bar@foo.bar",
                2 => "x400:foo",
            ],
            'count' => 2,
            'dn' => "CN=foo,DC=foo,DC=bar",
        ],
    ];

    function let(LdapConnectionInterface $connection)
    {
        $this->connection = $connection;
        $options = [
            'addressType' => [
                'exchangeSmtpAddress' => 'smtp',
                'exchangeDefaultSmtpAddress' => 'smtp',
            ],
            'default' => [
                'exchangeDefaultSmtpAddress'
            ],
        ];
        $this->setOptions($options);
        $this->setLdapConnection($connection);
        $this->setDn('cn=foo,dc=foo,dc=bar');
    }

    function it_is_initializable()
    {
        $this->shouldHaveType('LdapTools\AttributeConverter\ConvertExchangeProxyAddress');
    }

    function it_is_initializable()
    {
        $this->shouldHaveType('LdapTools\AttributeConverter\ConvertExchangeProxyAddress');
    }

    function it_should_convert_an_array_of_addresses_to_an_array_of_specific_address_types()
    {
        $smtp = ['<EMAIL>','<EMAIL>'];
        $this->setAttribute('exchangeSmtpAddress');
        // 514 represents a "normal account" with the disabled bit set.
        $this->fromLdap(['smtp:<EMAIL>','SMTP:<EMAIL>','x400:foo'])->shouldBeEqualTo($smtp);
{'fraction_non_alphanumeric': 0.13878923766816142, 'fraction_numerical': 0.02062780269058296, 'mean_word_length': 2.4315384615384614, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 62, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7321990', 'n_tokens_mistral': 1441, 'n_tokens_neox': 1381, 'n_words': 227}