PHP Classes

File: tests/fixtures/data/device_token.php

Recommend this page to a friend!
  Packages of Edgar Asatryan   YII2 notymo   tests/fixtures/data/device_token.php   Download  
File: tests/fixtures/data/device_token.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: YII2 notymo
Send iOS and Android push notifications
Author: By
Last change:
Date: 9 years ago
Size: 427 bytes
 

 

Contents

Class file image Download
<?php
use nstdio\yii2notymo\tests\fixtures\DeviceTokenFixture;

$data = [];
$security = Yii::$app->getSecurity();
$range = range(0, 10);

foreach ($range as $i) {
    $nulls = mt_rand() % 13 === 0;
    $data[] = [
        'user_id'    => $i + 1,
        'apns_token' => $nulls ? DeviceTokenFixture::apnsTokenGenerator() : null,
        'gcm_token'  => $nulls ? $security->generateRandomString() : null,
    ];
}

return $data;