Skip to content

Commit

Permalink
Update library
Browse files Browse the repository at this point in the history
  • Loading branch information
igorgoroun committed Jun 30, 2017
1 parent 4b85cb8 commit 30874e2
Show file tree
Hide file tree
Showing 16 changed files with 57 additions and 64 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
Tests/Resources/Created/*.tmp
.phpintel


9 changes: 0 additions & 9 deletions FTNPacketBundle.php

This file was deleted.

10 changes: 5 additions & 5 deletions Tests/Controller/ParseAddressTest.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?php

namespace IgorGoroun\FTNPacketBundle\Tests\Controller;
namespace IgorGoroun\FTNPacket\Tests\Controller;

use IgorGoroun\FTNPacketBundle\Entity\Address;
use IgorGoroun\FTNPacketBundle\Entity\Packet;
use IgorGoroun\FTNPacketBundle\Entity\Parser;
use IgorGoroun\FTNPacket\Address;
use IgorGoroun\FTNPacket\Packet;
use IgorGoroun\FTNPacket\Parser;
use IgorGoroun\FTNPacket\Message;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Component\Finder\Finder;
use Symfony\Component\Serializer\Encoder\JsonEncoder;
use Symfony\Component\Serializer\Encoder\YamlEncoder;
use Symfony\Component\Serializer\Normalizer\ObjectNormalizer;
use Symfony\Component\Serializer\Serializer;
use IgorGoroun\FTNPacketBundle\Entity\Message;


class ParseAddressTest extends WebTestCase
Expand Down
28 changes: 14 additions & 14 deletions Tests/Controller/ParsePacketTest.php
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<?php

namespace IgorGoroun\FTNPacketBundle\Tests\Controller;
namespace IgorGoroun\FTNPacket\Tests\Controller;

use IgorGoroun\FTNPacketBundle\Entity\Address;
use IgorGoroun\FTNPacketBundle\Entity\Packet;
use IgorGoroun\FTNPacketBundle\Entity\Parser;
use IgorGoroun\FTNPacketBundle\Entity\Uuefile;
use IgorGoroun\FTNPacket\Address;
use IgorGoroun\FTNPacket\Packet;
use IgorGoroun\FTNPacket\Parser;
use IgorGoroun\FTNPacket\Uuefile;
use IgorGoroun\FTNPacket\Message;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Component\Finder\Finder;
use Symfony\Component\Serializer\Encoder\JsonEncoder;
use Symfony\Component\Serializer\Encoder\YamlEncoder;
use Symfony\Component\Serializer\Normalizer\ObjectNormalizer;
use Symfony\Component\Serializer\Serializer;
use IgorGoroun\FTNPacketBundle\Entity\Message;


class ParsePacketTest extends WebTestCase
Expand All @@ -24,7 +24,7 @@ public function testPacketHeader()
//$crawler = $client->request('GET', '/');
//$this->assertContains('Hello World', $client->getResponse()->getContent());
$finder = new Finder();
$finder->files()->in('src/IgorGoroun/FTNPacketBundle/Tests/Resources/Echomail')->name('57B435B7.PKT');
$finder->files()->in('src/IgorGoroun/ftnpacket/Tests/Resources/Echomail')->name('57B435B7.PKT');
foreach ($finder as $file) {
$packet = (new Parser($file->getPathname()))->parsePacket();
$this->assertNotEmpty($packet->getHeader()->getDate());
Expand All @@ -42,7 +42,7 @@ public function testPacketHeader()
public function testPacketEchomailMessages()
{
$finder = new Finder();
$finder->files()->in('src/IgorGoroun/FTNPacketBundle/Tests/Resources/Echomail')->name('57B44611.PKT');
$finder->files()->in('src/IgorGoroun/ftnpacket/Tests/Resources/Echomail')->name('57B44611.PKT');
foreach ($finder as $file) {
$packet = (new Parser($file->getPathname()))->parsePacket();

Expand Down Expand Up @@ -76,7 +76,7 @@ public function testPacketEchomailMessages()
public function testPacketEchomailUUE()
{
$finder = new Finder();
$finder->files()->in('src/IgorGoroun/FTNPacketBundle/Tests/Resources/Echomail')->name('58c30f20.PKT');
$finder->files()->in('src/IgorGoroun/ftnpacket/Tests/Resources/Echomail')->name('58c30f20.PKT');
foreach ($finder as $file) {
$packet = (new Parser($file->getPathname()))->parsePacket();

Expand Down Expand Up @@ -110,7 +110,7 @@ public function testPacketEchomailUUE()
public function testNetmailMessageOtherZone()
{
$finder = new Finder();
$finder->files()->in('src/IgorGoroun/FTNPacketBundle/Tests/Resources/Netmail')->name('58B08F69.PKT');
$finder->files()->in('src/IgorGoroun/ftnpacket/Tests/Resources/Netmail')->name('58B08F69.PKT');
foreach ($finder as $file) {
$packet = (new Parser($file->getPathname()))->parsePacket();

Expand Down Expand Up @@ -143,7 +143,7 @@ public function testNetmailMessageOtherZone()
public function testNetmailMessageFromNodeAddr()
{
$finder = new Finder();
$finder->files()->in('src/IgorGoroun/FTNPacketBundle/Tests/Resources/Netmail')->name('58B09980.PKT');
$finder->files()->in('src/IgorGoroun/ftnpacket/Tests/Resources/Netmail')->name('58B09980.PKT');
foreach ($finder as $file) {
$packet = (new Parser($file->getPathname()))->parsePacket();

Expand Down Expand Up @@ -177,7 +177,7 @@ public function testNetmailMessageFromNodeAddr()
public function testNetmailMessageFromOtherRegionAndEcho()
{
$finder = new Finder();
$finder->files()->in('src/IgorGoroun/FTNPacketBundle/Tests/Resources/Netmail')->name('58B099BD.PKT');
$finder->files()->in('src/IgorGoroun/ftnpacket/Tests/Resources/Netmail')->name('58B099BD.PKT');
foreach ($finder as $file) {
$packet = (new Parser($file->getPathname()))->parsePacket();

Expand Down Expand Up @@ -210,7 +210,7 @@ public function testNetmailMessageFromOtherRegionAndEcho()
public function testNetmailMessageFromOtherRegion2()
{
$finder = new Finder();
$finder->files()->in('src/IgorGoroun/FTNPacketBundle/Tests/Resources/Netmail')->name('58B09D50.PKT');
$finder->files()->in('src/IgorGoroun/ftnpacket/Tests/Resources/Netmail')->name('58B09D50.PKT');
foreach ($finder as $file) {
$packet = (new Parser($file->getPathname()))->parsePacket();

Expand Down Expand Up @@ -243,7 +243,7 @@ public function testNetmailMessageFromOtherRegion2()
public function testOtherFile()
{
$finder = new Finder();
$finder->files()->in('src/IgorGoroun/FTNPacketBundle/Tests/Resources/Other')->name('gedcolor.cfg');
$finder->files()->in('src/IgorGoroun/ftnpacket/Tests/Resources/Other')->name('gedcolor.cfg');
foreach ($finder as $file) {
$packet = (new Parser($file->getPathname()))->parsePacket();
$this->assertNotInstanceOf(Packet::class, $packet);
Expand Down
20 changes: 10 additions & 10 deletions Tests/Controller/RWPacketStressTest.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

namespace IgorGoroun\FTNPacketBundle\Tests\Controller;
namespace IgorGoroun\FTNPacket\Tests\Controller;

use IgorGoroun\FTNPacketBundle\Entity\Address;
use IgorGoroun\FTNPacketBundle\Entity\Packet;
use IgorGoroun\FTNPacketBundle\Entity\Parser;
use IgorGoroun\FTNPacketBundle\Entity\Message;
use IgorGoroun\FTNPacketBundle\Entity\Writer;
use IgorGoroun\FTNPacket\Address;
use IgorGoroun\FTNPacket\Packet;
use IgorGoroun\FTNPacket\Parser;
use IgorGoroun\FTNPacket\Message;
use IgorGoroun\FTNPacket\Writer;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\Finder\Finder;
Expand All @@ -18,9 +18,9 @@ class RWPacketStressTest extends WebTestCase
public function testStressNetmail()
{
$finder = new Finder();
$finder->files()->in('src/IgorGoroun/FTNPacketBundle/Tests/Resources/Netmail')->name('58B08F69.PKT');
$finder->files()->in('src/IgorGoroun/ftnpacket/Tests/Resources/Netmail')->name('58B08F69.PKT');
$fs = new Filesystem();
$tmpFile = 'src/IgorGoroun/FTNPacketBundle/Tests/Resources/Created/current_netmails_%s.tmp';
$tmpFile = 'src/IgorGoroun/ftnpacket/Tests/Resources/Created/current_netmails_%s.tmp';
foreach ($finder as $file) {
for ($j=0;$j<10;$j++) {
$packet = (new Parser($file->getPathname()))->parsePacket();
Expand All @@ -41,9 +41,9 @@ public function testStressNetmail()
public function testStressPacketRW()
{
$finder = new Finder();
$finder->files()->in('src/IgorGoroun/FTNPacketBundle/Tests/Resources/Echomail')->name('57B44611.PKT');
$finder->files()->in('src/IgorGoroun/ftnpacket/Tests/Resources/Echomail')->name('57B44611.PKT');
$fs = new Filesystem();
$tmpFile = 'src/IgorGoroun/FTNPacketBundle/Tests/Resources/Created/current_echo_%s.tmp';
$tmpFile = 'src/IgorGoroun/ftnpacket/Tests/Resources/Created/current_echo_%s.tmp';
foreach ($finder as $file) {
for ($j=0;$j<10;$j++) {
$packet = (new Parser($file->getPathname()))->parsePacket();
Expand Down
20 changes: 10 additions & 10 deletions Tests/Controller/WritePacketTest.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

namespace IgorGoroun\FTNPacketBundle\Tests\Controller;
namespace IgorGoroun\FTNPacket\Tests\Controller;

use IgorGoroun\FTNPacketBundle\Entity\Address;
use IgorGoroun\FTNPacketBundle\Entity\Packet;
use IgorGoroun\FTNPacketBundle\Entity\Parser;
use IgorGoroun\FTNPacketBundle\Entity\Message;
use IgorGoroun\FTNPacketBundle\Entity\Writer;
use IgorGoroun\FTNPacket\Address;
use IgorGoroun\FTNPacket\Packet;
use IgorGoroun\FTNPacket\Parser;
use IgorGoroun\FTNPacket\Message;
use IgorGoroun\FTNPacket\Writer;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\Finder\Finder;
Expand All @@ -18,9 +18,9 @@ class WritePacketTest extends WebTestCase
public function testWriteNetmail()
{
$finder = new Finder();
$finder->files()->in('src/IgorGoroun/FTNPacketBundle/Tests/Resources/Netmail')->name('58B08F69.PKT');
$finder->files()->in('src/IgorGoroun/ftnpacket/Tests/Resources/Netmail')->name('58B08F69.PKT');
$fs = new Filesystem();
$tmpFile = 'src/IgorGoroun/FTNPacketBundle/Tests/Resources/Created/current_netmails_%s.tmp';
$tmpFile = 'src/IgorGoroun/ftnpacket/Tests/Resources/Created/current_netmails_%s.tmp';
$i = 0;
foreach ($finder as $file) {
$packet = (new Parser($file->getPathname()))->parsePacket();
Expand All @@ -39,9 +39,9 @@ public function testWriteNetmail()
public function testWriteCollected()
{
$finder = new Finder();
$finder->files()->in('src/IgorGoroun/FTNPacketBundle/Tests/Resources/Netmail')->name('58B099BD.PKT');
$finder->files()->in('src/IgorGoroun/ftnpacket/Tests/Resources/Netmail')->name('58B099BD.PKT');
$fs = new Filesystem();
$tmpFile = 'src/IgorGoroun/FTNPacketBundle/Tests/Resources/Created/current_collect_%s.tmp';
$tmpFile = 'src/IgorGoroun/ftnpacket/Tests/Resources/Created/current_collect_%s.tmp';
$i = 0;
foreach ($finder as $file) {
$packet = (new Parser($file->getPathname()))->parsePacket();
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"wapmorgan/binary-stream": "^0.2.3"
},
"autoload": {
"psr-4": {"IgorGoroun\\FTNPacketBundle\\": ""}
"psr-4": {"IgorGoroun\\FTNPacket\\": "src/"}
},
"extra": {
"branch-alias": {
Expand Down
4 changes: 2 additions & 2 deletions Entity/Address.php → src/Address.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
* Time: 15:13
*/

namespace IgorGoroun\FTNPacketBundle\Entity;
namespace IgorGoroun\FTNPacket;

/**
* Class Address
* @package IgorGoroun\FTNPacketBundle\Entity
* @package IgorGoroun\FTNPacket
*/
class Address
{
Expand Down
2 changes: 1 addition & 1 deletion Entity/Encoder.php → src/Encoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Time: 19:37
*/

namespace IgorGoroun\FTNPacketBundle\Entity;
namespace IgorGoroun\FTNPacket;


class Encoder
Expand Down
4 changes: 2 additions & 2 deletions Entity/Header.php → src/Header.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
* Time: 20:50
*/

namespace IgorGoroun\FTNPacketBundle\Entity;
namespace IgorGoroun\FTNPacket;

/**
* Class Header
* @package IgorGoroun\FTNPacketBundle\Entity
* @package IgorGoroun\FTNPacket
*/
class Header
{
Expand Down
2 changes: 1 addition & 1 deletion Entity/Kludge.php → src/Kludge.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Time: 22:56
*/

namespace IgorGoroun\FTNPacketBundle\Entity;
namespace IgorGoroun\FTNPacket;


class Kludge
Expand Down
4 changes: 2 additions & 2 deletions Entity/Message.php → src/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
* Time: 20:50
*/

namespace IgorGoroun\FTNPacketBundle\Entity;
namespace IgorGoroun\FTNPacket;

/**
* Class Message
* @package IgorGoroun\FTNPacketBundle\Entity
* @package IgorGoroun\FTNPacket
*/
class Message
{
Expand Down
4 changes: 2 additions & 2 deletions Entity/Packet.php → src/Packet.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
* Time: 20:47
*/

namespace IgorGoroun\FTNPacketBundle\Entity;
namespace IgorGoroun\FTNPacket;

/**
* Class Packet
* @package IgorGoroun\FTNPacketBundle\Entity
* @package IgorGoroun\FTNPacket
*/
class Packet
{
Expand Down
4 changes: 2 additions & 2 deletions Entity/Parser.php → src/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
* Time: 15:23
*/

namespace IgorGoroun\FTNPacketBundle\Entity;
namespace IgorGoroun\FTNPacket;

use Psr\Log\LoggerInterface;
use wapmorgan\BinaryStream\BinaryStream;


/**
* Class Parser
* @package IgorGoroun\FTNPacketBundle\Entity
* @package IgorGoroun\FTNPacket
*/
class Parser
{
Expand Down
2 changes: 1 addition & 1 deletion Entity/Uuefile.php → src/Uuefile.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* end
*/

namespace IgorGoroun\FTNPacketBundle\Entity;
namespace IgorGoroun\FTNPacket;


class Uuefile
Expand Down
4 changes: 2 additions & 2 deletions Entity/Writer.php → src/Writer.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
* Time: 15:21
*/

namespace IgorGoroun\FTNPacketBundle\Entity;
namespace IgorGoroun\FTNPacket;

use wapmorgan\BinaryStream\BinaryStream;

/**
* Class Writer
* @package IgorGoroun\FTNPacketBundle\Entity
* @package IgorGoroun\FTNPacket
*/
class Writer
{
Expand Down

0 comments on commit 30874e2

Please sign in to comment.