Page Menu
Home
Phabricator (Chris)
Search
Configure Global Search
Log In
Files
F629219
LocationTest.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
LocationTest.php
View Options
<?php
/**
* This file is part of the TelegramBot package.
*
* (c) Avtandil Kikabidze aka LONGMAN <akalongman@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace
Longman
\
TelegramBot
\
Tests
\
Unit
;
use
Longman
\
TelegramBot
\
Entities
\
Location
;
/**
* @package TelegramTest
* @author Baev Nikolay <gametester3d@gmail.com>
* @copyright Avtandil Kikabidze <akalongman@gmail.com>
* @license http://opensource.org/licenses/mit-license.php The MIT License (MIT)
* @link https://github.com/php-telegram-bot/core
*/
class
LocationTest
extends
TestCase
{
private
$coordinates
;
public
function
setUp
(
)
:
void
{
$this
->
coordinates
=
[
'longitude'
=>
(float)
mt_rand
(
10
,
69
)
,
'latitude'
=>
(float)
mt_rand
(
10
,
48
)
,
]
;
}
public
function
testBaseStageLocation
(
)
{
$location
=
new
Location
(
$this
->
coordinates
)
;
$this
->
assertInstanceOf
(
Location
::
class
,
$location
)
;
}
public
function
testGetLongitude
(
)
{
$location
=
new
Location
(
$this
->
coordinates
)
;
$long
=
$location
->
getLongitude
(
)
;
$this
->
assertIsFloat
(
$long
)
;
$this
->
assertEquals
(
$this
->
coordinates
[
'longitude'
]
,
$long
)
;
}
public
function
testGetLatitude
(
)
{
$location
=
new
Location
(
$this
->
coordinates
)
;
$lat
=
$location
->
getLatitude
(
)
;
$this
->
assertIsFloat
(
$lat
)
;
$this
->
assertEquals
(
$this
->
coordinates
[
'latitude'
]
,
$lat
)
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Nov 15, 6:15 AM (1 d, 22 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
138599
Default Alt Text
LocationTest.php (1 KB)
Attached To
Mode
R123 php-telegram-bot
Attached
Detach File
Event Timeline