Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7460368
LiveCoding3Test.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
LiveCoding3Test.php
View Options
<?php
/**
* Tests that unclosed docblocks during live coding are handled correctly.
*
* @author Juliette Reinders Folmer <phpcs_nospam@adviesenzo.nl>
* @copyright 2024 PHPCSStandards and contributors
* @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence
*/
namespace
PHP_CodeSniffer\Tests\Core\Tokenizer\Comment
;
/**
* Tests that unclosed docblocks during live coding are handled correctly.
*
* @covers PHP_CodeSniffer\Tokenizers\Comment
*/
final
class
LiveCoding3Test
extends
CommentTestCase
{
/**
* Data provider.
*
* @see testDocblockOpenerCloser()
*
* @return array<string, array<string, string|int|array<int>>>
*/
public
static
function
dataDocblockOpenerCloser
()
{
return
[
'live coding: unclosed docblock, no contents, no blank line at end of file'
=>
[
'marker'
=>
'/* testLiveCoding */'
,
'closerOffset'
=>
1
,
'expectedTags'
=>
[],
],
];
}
//end dataDocblockOpenerCloser()
/**
* Verify tokenization of the DocBlock.
*
* @phpcs:disable Squiz.Arrays.ArrayDeclaration.SpaceBeforeDoubleArrow -- Readability is better with alignment.
*
* @return void
*/
public
function
testLiveCoding
()
{
$expectedSequence
=
[
[
T_DOC_COMMENT_OPEN_TAG
=>
'/**'
],
[
T_DOC_COMMENT_CLOSE_TAG
=>
''
],
];
$target
=
$this
->
getTargetToken
(
'/* '
.
__FUNCTION__
.
' */'
,
T_DOC_COMMENT_OPEN_TAG
);
$this
->
checkTokenSequence
(
$target
,
$expectedSequence
);
}
//end testLiveCoding()
}
//end class
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, Nov 23, 02:35 (2 d, 20 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
2d/ba/d2c6de06317295a018c71a591320
Default Alt Text
LiveCoding3Test.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment