Subversion Repository Public Repository

Nextrek

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php

use Facebook\FacebookRequest;
use Facebook\GraphAlbum;

class GraphAlbumTest extends PHPUnit_Framework_TestCase
{

  const ALBUM_DESCRIPTION = "Album Description";
  const ALBUM_NAME = "Album Name";

  public function testMeReturnsGraphAlbum()
  {
    $response = (
    new FacebookRequest(
        FacebookTestHelper::$testSession,
        'POST',
        '/me/albums',
        array(
            'name' => self::ALBUM_NAME,
            'message' => self::ALBUM_DESCRIPTION,
            'value' => 'everyone'
        )
    ))->execute()->getGraphObject();

    $albumId = $response->getProperty('id');

    $response = (
    new FacebookRequest(
        FacebookTestHelper::$testSession,
        'GET',
        '/'.$albumId
    ))->execute()->getGraphObject(GraphAlbum::className());

    $this->assertTrue($response instanceof GraphAlbum);
    $this->assertEquals($albumId, $response->getId());
    $this->assertTrue($response->getFrom() instanceof \Facebook\GraphUser);
    $this->assertTrue($response->canUpload());
    $this->assertEquals(0, $response->getCount());
    $this->assertEquals(self::ALBUM_NAME, $response->getName());
    $this->assertEquals(self::ALBUM_DESCRIPTION, $response->getDescription());
    $this->assertNotNull($response->getLink());
    $this->assertNotNull($response->getPrivacy());

    $type = array("profile", "mobile", "wall", "normal", "album");
    $this->assertTrue(in_array($response->getType(),$type));

    date_default_timezone_set('GMT');
    $this->assertTrue($response->getCreatedTime() instanceof DateTime);
    $this->assertTrue($response->getUpdatedTime() instanceof DateTime);
  }

}

Commits for Nextrek/Android/SmartCharging/endPoints/nightly/fb_SDK/tests/GraphAlbumTest.php

Diff revisions: vs.
Revision Author Commited Message
461 FSallustio picture FSallustio Mon 03 Aug, 2015 10:04:56 +0000

Aggiunto supporto login Facebook, logout utente e modifiche (solo lato repo) all’utente e al locale.