diff --git a/core/email.class.inc.php b/core/email.class.inc.php index 9eb7853af..36122e56f 100644 --- a/core/email.class.inc.php +++ b/core/email.class.inc.php @@ -493,23 +493,17 @@ class EMail class Swift_Transport_LogFileTransport extends Swift_Transport_NullTransport { protected $sLogFile; - + /** - * Sends the given message. - * - * @param Swift_Mime_Message $message - * @param string[] $failedRecipients An array of failures by-reference - * - * @return int The number of sent emails + * @inheritDoc */ - public function send(Swift_Mime_Message $message, &$failedRecipients = null) + public function send(Swift_Mime_SimpleMessage $message, &$failedRecipients = null) { $hFile = @fopen($this->sLogFile, 'a'); - if ($hFile) - { + if ($hFile) { $sTxt = "================== ".date('Y-m-d H:i:s')." ==================\n"; $sTxt .= $message->toString()."\n"; - + @fwrite($hFile, $sTxt); @fclose($hFile); } @@ -534,12 +528,13 @@ class Swift_LogFileTransport extends Swift_Transport_LogFileTransport /** * Create a new LogFileTransport. */ - public function __construct() + public function __construct(Swift_Events_EventDispatcher $eventDispatcher) { + parent::__construct($eventDispatcher); call_user_func_array( - array($this, 'Swift_Transport_LogFileTransport::__construct'), - Swift_DependencyContainer::getInstance() - ->createDependenciesFor('transport.null') + array($this, 'Swift_Transport_LogFileTransport::__construct'), + Swift_DependencyContainer::getInstance() + ->createDependenciesFor('transport.null') ); } diff --git a/lib/doctrine/lexer/tests/Doctrine/Common/Lexer/AbstractLexerTest.php b/lib/doctrine/lexer/tests/Doctrine/Common/Lexer/AbstractLexerTest.php deleted file mode 100644 index 8a2a4e49c..000000000 --- a/lib/doctrine/lexer/tests/Doctrine/Common/Lexer/AbstractLexerTest.php +++ /dev/null @@ -1,268 +0,0 @@ -concreteLexer = new ConcreteLexer(); - } - - public function dataProvider() - { - return array( - array( - 'price=10', - array( - array( - 'value' => 'price', - 'type' => 'string', - 'position' => 0, - ), - array( - 'value' => '=', - 'type' => 'operator', - 'position' => 5, - ), - array( - 'value' => 10, - 'type' => 'int', - 'position' => 6, - ), - ), - ), - ); - } - - public function testResetPeek() - { - $expectedTokens = array( - array( - 'value' => 'price', - 'type' => 'string', - 'position' => 0, - ), - array( - 'value' => '=', - 'type' => 'operator', - 'position' => 5, - ), - array( - 'value' => 10, - 'type' => 'int', - 'position' => 6, - ), - ); - - $this->concreteLexer->setInput('price=10'); - - $this->assertEquals($expectedTokens[0], $this->concreteLexer->peek()); - $this->assertEquals($expectedTokens[1], $this->concreteLexer->peek()); - $this->concreteLexer->resetPeek(); - $this->assertEquals($expectedTokens[0], $this->concreteLexer->peek()); - } - - public function testResetPosition() - { - $expectedTokens = array( - array( - 'value' => 'price', - 'type' => 'string', - 'position' => 0, - ), - array( - 'value' => '=', - 'type' => 'operator', - 'position' => 5, - ), - array( - 'value' => 10, - 'type' => 'int', - 'position' => 6, - ), - ); - - $this->concreteLexer->setInput('price=10'); - $this->assertNull($this->concreteLexer->lookahead); - - $this->assertTrue($this->concreteLexer->moveNext()); - $this->assertEquals($expectedTokens[0], $this->concreteLexer->lookahead); - - $this->assertTrue($this->concreteLexer->moveNext()); - $this->assertEquals($expectedTokens[1], $this->concreteLexer->lookahead); - - $this->concreteLexer->resetPosition(0); - - $this->assertTrue($this->concreteLexer->moveNext()); - $this->assertEquals($expectedTokens[0], $this->concreteLexer->lookahead); - } - - /** - * @dataProvider dataProvider - * - * @param $input - * @param $expectedTokens - */ - public function testMoveNext($input, $expectedTokens) - { - $this->concreteLexer->setInput($input); - $this->assertNull($this->concreteLexer->lookahead); - - for ($i = 0; $i < count($expectedTokens); $i++) { - $this->assertTrue($this->concreteLexer->moveNext()); - $this->assertEquals($expectedTokens[$i], $this->concreteLexer->lookahead); - } - - $this->assertFalse($this->concreteLexer->moveNext()); - $this->assertNull($this->concreteLexer->lookahead); - } - - public function testSkipUntil() - { - $this->concreteLexer->setInput('price=10'); - - $this->assertTrue($this->concreteLexer->moveNext()); - $this->concreteLexer->skipUntil('operator'); - - $this->assertEquals( - array( - 'value' => '=', - 'type' => 'operator', - 'position' => 5, - ), - $this->concreteLexer->lookahead - ); - } - - public function testUtf8Mismatch() - { - $this->concreteLexer->setInput("\xE9=10"); - - $this->assertTrue($this->concreteLexer->moveNext()); - - $this->assertEquals( - array( - 'value' => "\xE9=10", - 'type' => 'string', - 'position' => 0, - ), - $this->concreteLexer->lookahead - ); - } - - /** - * @dataProvider dataProvider - * - * @param $input - * @param $expectedTokens - */ - public function testPeek($input, $expectedTokens) - { - $this->concreteLexer->setInput($input); - foreach ($expectedTokens as $expectedToken) { - $this->assertEquals($expectedToken, $this->concreteLexer->peek()); - } - - $this->assertNull($this->concreteLexer->peek()); - } - - /** - * @dataProvider dataProvider - * - * @param $input - * @param $expectedTokens - */ - public function testGlimpse($input, $expectedTokens) - { - $this->concreteLexer->setInput($input); - - foreach ($expectedTokens as $expectedToken) { - $this->assertEquals($expectedToken, $this->concreteLexer->glimpse()); - $this->concreteLexer->moveNext(); - } - - $this->assertNull($this->concreteLexer->peek()); - } - - public function inputUntilPositionDataProvider() - { - return array( - array('price=10', 5, 'price'), - ); - } - - /** - * @dataProvider inputUntilPositionDataProvider - * - * @param $input - * @param $position - * @param $expectedInput - */ - public function testGetInputUntilPosition($input, $position, $expectedInput) - { - $this->concreteLexer->setInput($input); - - $this->assertSame($expectedInput, $this->concreteLexer->getInputUntilPosition($position)); - } - - /** - * @dataProvider dataProvider - * - * @param $input - * @param $expectedTokens - */ - public function testIsNextToken($input, $expectedTokens) - { - $this->concreteLexer->setInput($input); - - $this->concreteLexer->moveNext(); - for ($i = 0; $i < count($expectedTokens); $i++) { - $this->assertTrue($this->concreteLexer->isNextToken($expectedTokens[$i]['type'])); - $this->concreteLexer->moveNext(); - } - } - - /** - * @dataProvider dataProvider - * - * @param $input - * @param $expectedTokens - */ - public function testIsNextTokenAny($input, $expectedTokens) - { - $allTokenTypes = array_map(function ($token) { - return $token['type']; - }, $expectedTokens); - - $this->concreteLexer->setInput($input); - - $this->concreteLexer->moveNext(); - for ($i = 0; $i < count($expectedTokens); $i++) { - $this->assertTrue($this->concreteLexer->isNextTokenAny(array($expectedTokens[$i]['type']))); - $this->assertTrue($this->concreteLexer->isNextTokenAny($allTokenTypes)); - $this->concreteLexer->moveNext(); - } - } - - public function testGetLiteral() - { - $this->assertSame('Doctrine\Tests\Common\Lexer\ConcreteLexer::INT', $this->concreteLexer->getLiteral('int')); - $this->assertSame('fake_token', $this->concreteLexer->getLiteral('fake_token')); - } - - public function testIsA() - { - $this->assertTrue($this->concreteLexer->isA(11, 'int')); - $this->assertTrue($this->concreteLexer->isA(1.1, 'int')); - $this->assertTrue($this->concreteLexer->isA('=', 'operator')); - $this->assertTrue($this->concreteLexer->isA('>', 'operator')); - $this->assertTrue($this->concreteLexer->isA('<', 'operator')); - $this->assertTrue($this->concreteLexer->isA('fake_text', 'string')); - } -} diff --git a/lib/doctrine/lexer/tests/Doctrine/Common/Lexer/ConcreteLexer.php b/lib/doctrine/lexer/tests/Doctrine/Common/Lexer/ConcreteLexer.php deleted file mode 100644 index ed4d153d1..000000000 --- a/lib/doctrine/lexer/tests/Doctrine/Common/Lexer/ConcreteLexer.php +++ /dev/null @@ -1,49 +0,0 @@ -', - '[a-z]+', - '\d+', - ); - } - - protected function getNonCatchablePatterns() - { - return array( - '\s+', - '(.)', - ); - } - - protected function getType(&$value) - { - if (is_numeric($value)) { - $value = (int)$value; - - return 'int'; - } - if (in_array($value, array('=', '<', '>'))) { - return 'operator'; - } - if (is_string($value)) { - return 'string'; - } - - return; - } - - protected function getModifiers() - { - return parent::getModifiers().'u'; - } -} diff --git a/sources/Composer/iTopComposer.php b/sources/Composer/iTopComposer.php index 11ee89a91..d93266f79 100644 --- a/sources/Composer/iTopComposer.php +++ b/sources/Composer/iTopComposer.php @@ -96,6 +96,8 @@ class iTopComposer { $APPROOT_WITH_SLASHES = $this->GetApprootWithSlashes(); return array( + $APPROOT_WITH_SLASHES.'lib/doctrine/lexer/tests', + $APPROOT_WITH_SLASHES.'lib/goaop/framework/tests', $APPROOT_WITH_SLASHES.'lib/nikic/php-parser/test',