|
| 1 | +<?php |
| 2 | +/** |
| 3 | + * This file is part of the "dragon-code/pretty-routes" project. |
| 4 | + * |
| 5 | + * For the full copyright and license information, please view the LICENSE |
| 6 | + * file that was distributed with this source code. |
| 7 | + * |
| 8 | + * @author Andrey Helldar <helldar@dragon-code.pro> |
| 9 | + * @copyright 2024 Andrey Helldar |
| 10 | + * @license MIT |
| 11 | + * |
| 12 | + * @see https://github.com/TheDragonCode/pretty-routes |
| 13 | + */ |
| 14 | + |
| 15 | +namespaceTests\Localizations; |
| 16 | + |
| 17 | +useTests\TestCase; |
| 18 | + |
| 19 | +class ZhCnTestextends TestCase |
| 20 | +{ |
| 21 | +publicfunctiontestApp() |
| 22 | + { |
| 23 | +$this->setConfigLocale('zh_CN'); |
| 24 | + |
| 25 | +$response =$this->get('/routes'); |
| 26 | + |
| 27 | +$response->assertStatus(200); |
| 28 | + |
| 29 | +$response->assertSee('动作'); |
| 30 | +$response->assertSee('全部'); |
| 31 | +$response->assertSee('全部数量'); |
| 32 | +$response->assertSee('接口'); |
| 33 | +$response->assertSee('清除路由缓存'); |
| 34 | +$response->assertSee('废弃的'); |
| 35 | +$response->assertSee('域名'); |
| 36 | +$response->assertSee('加载中... 请稍候...'); |
| 37 | +$response->assertSee('方法'); |
| 38 | +$response->assertSee('中间件'); |
| 39 | +$response->assertSee('模块'); |
| 40 | +$response->assertSee('名称'); |
| 41 | +$response->assertSee('暂无数据'); |
| 42 | +$response->assertSee('没有找到相关记录'); |
| 43 | +$response->assertSee('的'); |
| 44 | +$response->assertSee('只有'); |
| 45 | +$response->assertSee('在 GitHub 上打开项目页面'); |
| 46 | +$response->assertSee('路径'); |
| 47 | +$response->assertSee('优先顺序'); |
| 48 | +$response->assertSee('刷新路由列表'); |
| 49 | +$response->assertSee('路由类型'); |
| 50 | +$response->assertSee('每页显示的路由数量'); |
| 51 | +$response->assertSee('路由'); |
| 52 | +$response->assertSee('搜索'); |
| 53 | +$response->assertSee('显示'); |
| 54 | +$response->assertSee('网页'); |
| 55 | +$response->assertSee('没有'); |
| 56 | + |
| 57 | +$response->assertSee('{0}-{1} 共 {2}'); |
| 58 | + |
| 59 | +$response->assertDontSee('Foo Bar'); |
| 60 | +$response->assertDontSee('Записей на странице'); |
| 61 | + } |
| 62 | + |
| 63 | +publicfunctiontestPackage() |
| 64 | + { |
| 65 | +$this->setConfigLocale('en','zh_CN'); |
| 66 | + |
| 67 | +$response =$this->get('/routes'); |
| 68 | + |
| 69 | +$response->assertStatus(200); |
| 70 | + |
| 71 | +$response->assertSee('动作'); |
| 72 | +$response->assertSee('全部'); |
| 73 | +$response->assertSee('全部数量'); |
| 74 | +$response->assertSee('接口'); |
| 75 | +$response->assertSee('清除路由缓存'); |
| 76 | +$response->assertSee('废弃的'); |
| 77 | +$response->assertSee('域名'); |
| 78 | +$response->assertSee('加载中... 请稍候...'); |
| 79 | +$response->assertSee('方法'); |
| 80 | +$response->assertSee('中间件'); |
| 81 | +$response->assertSee('模块'); |
| 82 | +$response->assertSee('名称'); |
| 83 | +$response->assertSee('暂无数据'); |
| 84 | +$response->assertSee('没有找到相关记录'); |
| 85 | +$response->assertSee('的'); |
| 86 | +$response->assertSee('只有'); |
| 87 | +$response->assertSee('在 GitHub 上打开项目页面'); |
| 88 | +$response->assertSee('路径'); |
| 89 | +$response->assertSee('优先顺序'); |
| 90 | +$response->assertSee('刷新路由列表'); |
| 91 | +$response->assertSee('路由类型'); |
| 92 | +$response->assertSee('每页显示的路由数量'); |
| 93 | +$response->assertSee('路由'); |
| 94 | +$response->assertSee('搜索'); |
| 95 | +$response->assertSee('显示'); |
| 96 | +$response->assertSee('网页'); |
| 97 | +$response->assertSee('没有'); |
| 98 | + |
| 99 | +$response->assertSee('{0}-{1} 共 {2}'); |
| 100 | + |
| 101 | +$response->assertDontSee('Foo Bar'); |
| 102 | +$response->assertDontSee('Записей на странице'); |
| 103 | + } |
| 104 | + |
| 105 | +publicfunctiontestIncorrect() |
| 106 | + { |
| 107 | +$this->setConfigLocale('en','foo'); |
| 108 | + |
| 109 | +$response =$this->get('/routes'); |
| 110 | + |
| 111 | +$response->assertStatus(200); |
| 112 | + |
| 113 | +$response->assertSee('Action'); |
| 114 | +$response->assertSee('All'); |
| 115 | +$response->assertSee('All'); |
| 116 | +$response->assertSee('Api'); |
| 117 | +$response->assertSee('Clear route cache'); |
| 118 | +$response->assertSee('Deprecated'); |
| 119 | +$response->assertSee('Domain'); |
| 120 | +$response->assertSee('Loading... Please wait...'); |
| 121 | +$response->assertSee('Methods'); |
| 122 | +$response->assertSee('Middlewares'); |
| 123 | +$response->assertSee('Module'); |
| 124 | +$response->assertSee('Name'); |
| 125 | +$response->assertSee('No data available'); |
| 126 | +$response->assertSee('No matching records found'); |
| 127 | +$response->assertSee('of'); |
| 128 | +$response->assertSee('Only'); |
| 129 | +$response->assertSee('Open the project page on GitHub'); |
| 130 | +$response->assertSee('Path'); |
| 131 | +$response->assertSee('Priority'); |
| 132 | +$response->assertSee('Refresh the list of routes'); |
| 133 | +$response->assertSee('Route types'); |
| 134 | +$response->assertSee('Routes per page'); |
| 135 | +$response->assertSee('Routes'); |
| 136 | +$response->assertSee('Search'); |
| 137 | +$response->assertSee('Show'); |
| 138 | +$response->assertSee('Web'); |
| 139 | +$response->assertSee('Without'); |
| 140 | + |
| 141 | +$response->assertSee('{0}-{1} of {2}'); |
| 142 | + |
| 143 | +$response->assertDontSee('Foo Bar'); |
| 144 | +$response->assertDontSee('Записей на странице'); |
| 145 | + } |
| 146 | +} |